Commit graph

1845 commits

Author SHA1 Message Date
Anders Hejlsberg ff5d38a94b
Merge pull request #33622 from microsoft/fix33580
Error when assertion function calls aren't CFA'd
2019-09-30 10:57:26 -07:00
Anders Hejlsberg 02395a9b27 Fix error message 2019-09-27 15:17:49 -07:00
Anders Hejlsberg 4648d6aeb2 Revise error messages + related spans + no errors on never-returning functions 2019-09-27 15:05:13 -07:00
Wesley Wigham 558ece72cb
Add support for capturing cpu profiles into tsc itself (#33586)
* Add support for capturing cpu profiles into tsc itself

* Accept baseline for new compiler option in showConfig

* Fix lints

* Support profiling build mode, only ever have one live profiling session

* Minor modification to enable/disable semaphore, accept re-cased baseline

* Add pid into autognerated cpuprofile path

* Rename to fix case

* Sanitize filepaths in emitted cpuprofile for easier adoption by enterprise people, add inspector to browser field
2019-09-27 13:34:44 -07:00
Michael Henderson b183b7fd51 Merge branch 'master' into mh/33603-error-message-for-missing-member 2019-09-26 17:30:25 -05:00
Michael Henderson 64683a1a4a update message, generate diagnostics, update src and accept baselines 2019-09-26 17:15:35 -05:00
Wesley Wigham 61cb06ce40
Allow allowJs and declaration to be used together (#32372)
* Allow allowJs and declaration to be used together

This intorduces a new symbol-based declaration emitter - currently this
is only used for JSON and JavaScript, as the output is likely worse than
what the other declaration emitter is capable of. In addition, it is
still incomplete - it does not yet support serializaing namespaces.

* Add tests for various import/export forms, add notes on export as namespace and fix export * from

* Tests & fixes for computed names

* Add test with current @enum tag behavior

* fix declaration emit for jsdoc @enum tags

* Small adjustments to base class serialization to fix bugs in it

* Guard against type/type parameter confusion when using typeParameterToName a bit

* Integrate feedback from PR

* Fix issue with export= declarations visibility calculation and type declaration emit that impacted all forms of declaration emit

* Only make one merged getCommonJsExportEquals symbol for a symbol

* Support preserving type reference directives in js declarations

* Skip declare mdoifiers for namespace members in ambient contexts

* FAKE ALIASES AND NAMESPACES EVERYWHERE

* Dont do namespace sugar when type members contain keyword names

* Fix json source file export modifier under new output

* Such clean nested aliasing, very wow

* Fix lint

* Add visibility errors, reuse type nodes where possible

* Suppoer having correctly named import types in bundled js declaration emit & adjust binding to allow namespaces with aliases to merge when the aliases look to be type-only

* Better support for module.exports = class expression

* Fix discovered crash bug

* Allow export assigned class expressions to be reachable symbols from external declarations

* Add missing semicolon

* Support @enum tag post-merge

* preserve comments on signatures and declarations where possible

* Basic support for js classy functions

* Add example we should do better with

* Prototype assignments make things a bit wonky, but the example from the PR seems OK

* Make a ton of changes to support the new way js classes are bound

* Remove some old comments, fix import and export default names

* Fix bug in object define handling and add tests for object define property declaration emit

* Fix organization nits from PR comments

* Preserve comments from jsdoc declarations on properties and js declaration type aliases

* Merge export declarations with identical specifiers

* Remove completed TODO comment

* Split lint

* Remove now-unused function

* PR feedback

* Add some project references tests, remove some checks from project refs codepaths that are now invalid

* Update project references tests again

* Merge and update project references tests

* Rename case

* Update test to include declaration output

* Remove yet another project refernces redirect extension check

* Update comment

* Add additional import ref to test

* Add shorthand prop to test

* Fix comment text

* Extract var to temp

* Simplify function and add whitespace

* Update project refs test to use incremental edit entry

* Stylistic refactors in the symbol serializer

* Another round of PR feedback, mostly style, small bugfix with constructors, and test showing bug in export assigned class expression name shadowing

* Use x instead of index
2019-09-26 14:27:16 -07:00
Anders Hejlsberg 8619bff9c2 Error on assertion and non-returning function calls that aren't CFA-ed 2019-09-26 13:51:24 -07:00
Nathan Shively-Sanders 500a0df6f3
Add useDefineForClassFields flag for Set -> Define property declaration (#33509)
* Disallow property/accessor overrides

Unless the base property or accessor is abstract

* Disallow uninitialised property overrides

This causes quite a few test breaks. We'll probably want to revert many
of them by switching to the upcoming `declare x: number` syntax.

* Updates from design review + fix ancient bug

1. Don't error when overriding properties from interfaces.
2. Fix error when overriding methods with other things. This had no
tests so I assume that the code was always dead and never worked.

* Need to add a couple of errors and squash one

Will update after checking out other branch for a minute

* Everything works so far

Need to test properties initialised in constructor

* Check for constructor initialisation

* change error wording

* Improve error wording

* Add codefix to add missing 'declare'

* Always emit accessors in .d.ts files

* Allow 'declare' on any uninitialised property decl

* Undo code moves

* Let sleeping dogs lie

* Correctly set NodeFlags.Ambient

And simplify redundant parts of check.

* Remove more unneeded code

* Update baselines

* Update baselines

* Update baselines

* Ignore this-property assignments

* Fix base-in-interface check

* Do not error when base parent is interface

* Fix base interface check

* Add missed baselines

* Fix check

* Fix new errors in services

* Fix new errors in services

* Fix errors in testRunner

* Add flag and turn off errors when on

* Structure of new emit is correct, fake content

It is 'hi'.

* Basically right emit

* Fix one last unitialised property declaration

* Haha no I missed another one

* Fix whitespace back to CRLF

* Minor fix and code cleanup

* New test case

* Fix bug in isInitializedProperty

* Updates from design meeting.

1. Change flag name to useDefineForClassFields (and flip polarity).
2. Forbid ES3 + useDefineForClassFields (since there is no
defineProperty).
3. Forbid overriding an abstract property-with-initializer with an
accessor.

* Update baselines

* Object.defineProperty for methods too

Using code from Ron from his upcoming refactor of the factory functions.

* Update slow baselines

* Improve error message

* Update src/compiler/transformers/utilities.ts

Co-Authored-By: Andrew Branch <andrewbranch@users.noreply.github.com>

* Add test of computed properties

* Remove done TODO
2019-09-26 13:25:05 -07:00
Orta Therox 4c9986f26c Merge master 2019-09-25 12:59:07 -04:00
Sheetal Nandi 992c211c22
Merge pull request #32028 from microsoft/referencesPrototypeSourceFile
For editing experience, use source instead of .d.ts files from project references
2019-09-24 13:16:53 -07:00
Sheetal Nandi fd3ba679ec Reword the option description per feedback 2019-09-24 12:22:42 -07:00
Wesley Wigham 26caa3793e
Introduce flattened error reporting for properties, call signatures, and construct signatures (#33473)
* Introduce flattened error reporting for properties, call signatures, and construct signatures

* Update message, specialize output for argument-less signatures

* Skip leading signature incompatability flattening

* Add return type specialized message
2019-09-23 16:08:44 -07:00
Troy Tae 350e305b0c fix: add "either" in code 1023 message 2019-09-18 15:34:35 +09:00
xiaofa 67aa2b22ac fix conflicts 2019-09-17 19:02:44 +08:00
Orta f9cc374d21
Merge pull request #33336 from JoshuaKGoldberg/enum-syntax-error-specifics
Added more helpful syntax error for enum member commas
2019-09-11 23:05:16 +02:00
Josh Goldberg 4e1768c170 Added '}' to allowed characters in diagnostic message 2019-09-11 15:32:58 -04:00
Josh Goldberg 49be51dcf3 Added more helpful syntax error for enum member commas
Switches the error message emitted by the parser to the more specific _"An enum member name must be followed by a ',' or '='."_ when the expected comma doesn't follow the member.
2019-09-09 22:11:56 -04:00
Josh Goldberg 99f9719ab3 Added codefix for numeric literals >= 2 ** 53
`Number.MAX_SAFE_INTEGER` is `2 ** 53 - 1`, so anything greater than that is a 'dangerous' integer to store as a traditional number. This adds a codefix to suggest converting them to a `bigint` literal.
2019-09-07 18:43:32 -04:00
Sheetal Nandi 54d9ce9247 Merge branch 'master' into referencesPrototypeSourceFile 2019-09-05 13:51:56 -07:00
Justin Bay 006a327320 Flag non-nullable values with call expressions in if statements as errors 2019-08-31 14:24:31 -04:00
xiaofa 909bc61f01 Add convert const to let 2019-08-30 18:05:07 +08:00
Wenlu Wang af9ca21643 add support for extract as interface (#31644)
* add support for extract as interface

* fix action assert

* Donot provide convert to interface if duplicate member
2019-08-28 11:34:40 -07:00
Sheetal Nandi 4c4ddf833d Merge branch 'master' into referencesPrototypeSourceFile 2019-08-21 15:42:36 -07:00
Andrew Branch 5d04250ea8
Improve “Add missing await” fix-all (#32922)
* Improve codeFixAll for add missing await

* Improve add missing await for initializers and fix-all

* Fix when only one side of a binary expression can have its initializer fixed
2019-08-20 16:53:28 -07:00
Hoang Pham 46b7972885 Add JSX codefix if available (#32281)
* Add JSX codefix if available

* Update react jsx.

* Update diagnostic code.
2019-08-16 12:46:55 -07:00
Klaus Meinhardt efa19f6777 remove useless condition as argumentExpression is always defined (#31567)
* remove useless condition as argumentExpression is always defined

* fix formatting

* remove obsolete diagnostic
2019-08-15 15:25:10 -07:00
Sheetal Nandi 31a26120f9
Merge pull request #32788 from microsoft/tsbuildFixes
Fixes for tsbuild scenarios
2019-08-14 09:07:24 -07:00
Wesley Wigham 4ab85bbf35
Add error message for keywords with escapes in them (#32718)
* Add error message for keywords with escapes in them

* Move check into parser during advance to next token to utilize context for contextual keywords

* git add .

* Add tests for extended escapes

* Better error courtesy of @DanielRossenwaser

* Add test of browser-inconsistent case and alter condition to match spec

* Merge adjacent conditions

* Use seperate functions for checking keywords vs not

* Use flags to track unicode escape presence

* Adjust error text
2019-08-12 16:00:38 -07:00
Ron Buckton bf054ae796
Add support for import.meta in System modules (#32797) 2019-08-12 13:00:58 -07:00
Ron Buckton 98b6db81d9
Allow accessors in ambient class declarations (#32787)
* Allow accessors in ambient class declarations

* Update src/compiler/transformers/declarations.ts

Co-Authored-By: Wesley Wigham <wewigham@microsoft.com>
2019-08-09 16:11:25 -07:00
Sheetal Nandi 9e8fbcd7f8 Transitively upstream blocked project should not build 2019-08-09 13:38:25 -07:00
Sheetal Nandi 666c4be844 Merge branch 'master' into referencesPrototypeSourceFile 2019-07-25 14:03:48 -07:00
Andrew Branch 4f3412153a
Parse quoted constructors as constructors, not methods (#31949)
* Parse quoted constructors as constructors, not methods

* Update baselines

* Fix disambiguation between quoted constructor and property named constructor

* Clean up parsing a bit

* Support escapes in constructor name

* Update baselines
2019-07-12 14:01:57 -07:00
Andrew Branch 89badcc9d5
Add 'Remove unnecessary await' suggestion and fix (#32363)
* Add remove unnecessary await fix

* Add test for removing unnecessary parens after await is gone

* Fix handling of numbers in property access expressions

* Don’t offer suggestion when awaited type is any/unknown

* Fix random other test

* Fix new expression edge cases

* Only remove parens for identifiers and call expressions
2019-07-12 11:03:20 -07:00
Andrew Branch 71bec5b698
Add quick fix to add missing 'await' (#32356)
* Start prototyping addMissingAwait codefix

* Filter by diagnostics that have missing-await related info

* Start writing tests and checking precedence

* Implement codeFixAll, add test for binary expressions

* Add test for iterables

* Add test for passing argument

* Add test for call/construct signatures

* Add test for awaiting initializer

* Improve assertion error

* Replace specific property access error with general one and add await related info

* Add test for property access

* Require code to be inside a function body to offer await

* Accept suggestion

Co-Authored-By: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>

* Add explicit test for code fix being not available unless something is a Promise

* Skip looking for function body if already in AwaitContext flags

* Inline getCodeActions function for symmetry
2019-07-12 10:07:55 -07:00
Sheetal Nandi 103fe5fbc5 Merge branch 'master' into referencesPrototypeSourceFile
Uptodate to 3.6.0-dev.20190711
2019-07-11 12:05:36 -07:00
Andrew Branch 8eb3822ae0
Merge pull request #28290 from rflorian/add-codefix-cannot-find-name-in-for-loop
Add codefix for 'Cannot find name' diagnostic
2019-07-10 21:47:36 -07:00
Sheetal Nandi b631850978 Add option disableSourceOfProjectReferenceRedirect to disable using sources of project reference redirect from editor 2019-07-10 15:49:53 -07:00
Andrew Branch 64501996cc
Update error code 2019-07-08 14:52:23 -07:00
Andrew Branch 6626a99f11
Fix bad rebase 2019-07-08 14:44:57 -07:00
Andrew Branch eb6b87aa26
Refactor to use related info everywhere 2019-07-08 14:37:45 -07:00
Andrew Branch 094a001982
Did you forget to use await? on arguments of function calls 2019-07-08 14:33:25 -07:00
Andrew Branch a3a076d79f
Did you forget to use await? for call and construct signatures 2019-07-08 14:01:25 -07:00
Andrew Branch 48fc6b8b17
Did you forget to use await? on iterables 2019-07-08 13:59:59 -07:00
Andrew Branch c48e34ef91
Did you forget to use await? for operators 2019-07-08 13:50:56 -07:00
Nathan Shively-Sanders 834a476a96 Merge branch 'master' into report-multiple-overload-errors 2019-07-08 09:33:24 -07:00
Ron Buckton e8bf9584aa
Improve type checking and inference for Generators and Async Generators (#30790)
* Improve typing for Generators and Async Generators

* Add TReturn and TNext to Iterator, IterableIterator, etc.

* Update ts internal Iterator to be assignable from global Iterator

* Make 'done' optional in IteratorYieldResult

* Revert Iterable and IterableIterator to simpler versions plus other fixes

* Add additional inference tests

* Added additional tests

* PR cleanup and minor async iteration type fix

* Updated diagnostics message and added non-strict tests

* Fix expected arity of Iterator/AsyncIterator
2019-07-03 21:55:59 -07:00
Florian Regensburger bd9f39dbcc Merge branch 'master' into add-codefix-cannot-find-name-in-for-loop 2019-07-02 00:41:27 +02:00
Nathan Shively-Sanders 71276a21af Merge branch 'master' into report-multiple-overload-errors 2019-06-28 16:24:38 -07:00
Nathan Shively-Sanders c48018f95e Merge branch 'master' into report-multiple-overload-errors 2019-06-28 16:02:35 -07:00
Titian Cernicova-Dragomir 768318b30c Improved error message for calling/constructing types 2019-06-28 23:23:16 +03:00
Nathan Shively-Sanders 0436cfca16 Do not report multiple diagnostics per signature.
If there are multiple diagnostics per signature, choose the signature
with the fewer diagnostics to report. If there are more than one with
the minimum, choose the latest in the overload set.
2019-06-26 12:56:14 -07:00
Andrew Branch 871bdeeec4
Merge pull request #31480 from andrewbranch/bug/25487
Fix invalid JSXExpressions having identifier-ish things in their trivia, improve error messages for comma expressions in JSX
2019-06-26 10:13:42 -07:00
Nathan Shively-Sanders 68968fd396 Improve error messages and related spans 2019-06-26 10:05:44 -07:00
Nathan Shively-Sanders 67b8ca77d9 Merge branch 'master' into report-multiple-overload-errors 2019-06-25 14:07:56 -07:00
Andrew Branch 6717d8d928
Merge pull request #31942 from andrewbranch/bug/30882
Improve error message on indexed access to private members of type parameters
2019-06-24 09:22:21 -07:00
Nathan Shively-Sanders 720ad5bf22 Improve error message and update baselines 2019-06-21 13:15:32 -07:00
Nathan Shively-Sanders ef0a8759bd Share code a bit better 2019-06-20 15:40:29 -07:00
Nathan Shively-Sanders afecb87d3f Use related spans to form a tree of errors.
Formatting is wrong, and I might want to format it as non-related spans,
but the structure is exactly a tree.
2019-06-20 08:54:31 -07:00
Nathan Shively-Sanders e5fd8766fa Merge branch 'master' into report-multiple-overload-errors 2019-06-19 10:46:51 -07:00
Nathan Shively-Sanders beddf9c02d Working, just not the way I would like
There are still separate errors instead of one + related spans for each
sub-error.
2019-06-18 10:12:32 -07:00
Nathan Shively-Sanders c65d9f261a Initial attempt. Totally doesn't work. 2019-06-18 08:30:18 -07:00
Josh Goldberg ca00b3248b Added --noImplicitThis code fix for functions used as object properties (#31138)
* Added --noImplicitThis code fix for functions used as object properties

Before trying out all the various possibilities for where these functions could be used, I figured I'd start out with a relatively simple use case to verify this is the right approach. Is it? 😄

Starts on #28964.

* Fixed function expression names; included new baselines

* Got JSDocs to work, hooray!

* Added test for 'any' case of no function uses

* Refactored for inferFunctionReferencesFromUsage

* Fixed inference bug: undefined references cause parameters to default

* Removed dead code comments
2019-06-17 19:00:15 -07:00
Andrew Branch 04fbd93bf8
Revert previous fix and improve error message instead 2019-06-17 15:21:21 -07:00
Paul van Brenk c5578a2b43 Update error message as requested by @danielrosenwasser 2019-06-04 19:08:34 -04:00
Paul van Brenk a658f728a9 Include the project filepath in the error message for files not being
listed in the 'include' pattern. TS6307
2019-06-02 11:54:48 -04:00
Ron Buckton dfd28d2751
Fix handling of empty 'types', 'typings', etc. fields in package.json (#31539) 2019-05-23 17:19:32 -07:00
Titian Cernicova-Dragomir 8ab0a25211 Improve error messages when indexing into a type (#31379)
* Improved error messages when indexing an object type with a literal string, a literal string union or a string.

* Added more specific message when using the indexing operator with an incompatible index argument.

* Fixed spelling and error message.
2019-05-23 15:27:50 -07:00
Nathan Shively-Sanders 4d27361680
Allow JS with isolated modules (#31483)
* Allow JS with isolated modules

Previously legacy JS code was not allowed; it was required to use ES6
module syntax. Unfortunately, the check happens after parsing but before
binding, and the commonjs module indicator isn't set until binding
because it's not syntactically simple like the ES6 module indicator,
which is set during parsing.

So I decided that JS should be allowed during isolatedModules
unconditionally. We're not going to be transforming it anyway.

* Update baselines

* Switch test to outDir instead of noEmit
2019-05-23 11:09:28 -07:00
Sheetal Nandi 85d3c5d7a1 Trace Package id at the module resolution site 2019-05-22 12:35:20 -07:00
Andrew Branch feaef9c829
Improve error message for JSXExpressions that are comma expressions 2019-05-21 14:21:44 -07:00
rflorian 8987e56e41
Fix error from master merge 2019-05-09 00:30:55 +02:00
rflorian d4529e8355
Merge branch 'master' into add-codefix-cannot-find-name-in-for-loop 2019-05-09 00:22:01 +02:00
Wenlu Wang 714821fc97 add refactor of extract type (#30562)
* add basically implement

* add rename location and add testcase

* collection type arguments

* disallow infer type

* add support for typedef convert

* refactor info to make type safe

* disallow type pred

* avoid unnecessary branch

* disallow type query

* haha😂

Co-Authored-By: Kingwl <kingwenlu@gmail.com>

* Update src/services/refactors/extractType.ts

Co-Authored-By: Kingwl <kingwenlu@gmail.com>

* Update src/services/refactors/extractType.ts

Co-Authored-By: Kingwl <kingwenlu@gmail.com>

* add more tests

* add template tag support in jsdoc

* add support of type parameters constraint

* add more tests

* merge branch

* add more tests

* refactor and update function name
2019-05-07 08:26:53 -07:00
Andrew Branch 56b19c9bf0
Merge pull request #31119 from andrewbranch/bug/31020
Emit grammar error on quoted constructors and class fields named “constructor”
2019-05-01 10:42:16 -10:00
uhyo b0143bb446 add relatedInfo to error message for 'await' used in non-async function 2019-05-02 02:33:24 +09:00
Josh Goldberg 6e736c120e Added custom error message when trying to assign constraint type to generic type parameter (#30394)
* Added custom error message when trying to assign constraint type to generic type parameter

Fixes #29049.

This also adds the new message in chained error messages. `typeParameterDiamond4.errors.txt` shows it appearing twice in the "diamond" scenario. I can't tell if this severely increased amount of nested messages is good or bad...?

* Updated diagnostic message per suggestion

* Align formatting with local custom
2019-04-30 08:35:22 -07:00
Collins Abitekaniza 7016d45447 Better errors for indexing gettable/settable values (#26446)
* give suggestions when index signature given

* add tests for noImplicitAny indexing on Object

* remove comments regarding error messages

* recommend set if el is on RHS of assignment else get

* add new baseline tests
2019-04-30 08:31:37 -07:00
Andrew Branch e81fa2198d
Emit error on class fields named "constructor" 2019-04-25 17:30:41 -07:00
Andrew Branch 9f601ff154
Change error code 2019-04-25 16:15:00 -07:00
Andrew Branch c5e6913ede
Add grammar error on quoted constructors for TS 3.5 2019-04-25 15:44:23 -07:00
amaksimovich2 5b79b942e8 add action for enabling experimentalDescorators option in user config… (#30484)
* add action for enabling experimentalDescorators option in user config file, change error message for this case #29035

* add missing changes in tests

* Add "experimental decorators" tests for jsconfig file
2019-04-25 14:55:04 -07:00
Ely Alamillo 591b25593d update error message and update baselines (#27628) 2019-04-25 13:16:41 -07:00
Wenlu Wang bc46c770bf allow literan enum const assertions (#30700)
* allow literan enum const assertions

* update desc
2019-04-25 10:09:21 -07:00
Ryan Cavanaugh 885d4d63c8
Remove "generate types" code (#31075) 2019-04-23 13:51:47 -07:00
Daniel Rosenwasser c74d25c115
30837 - Bad error message when default 'import'-ing an 'export =' without 'esModuleInterop' (#30847)
30837 - Bad error message when default 'import'-ing an 'export =' without 'esModuleInterop'
2019-04-23 11:23:06 -04:00
karthikkp 181d126b02 diagnostic messages conflicts resolved 2019-04-20 01:38:17 +05:30
Andrew Branch b6a0988052
Merge pull request #30776 from andrewbranch/feature/10178
Add flag to allow access to UMD globals from modules
2019-04-18 18:05:44 -07:00
Alexander T f5d4e66451 Bad error message when default 'import'-ing an 'export =' without 'esModuleInterop' 2019-04-16 14:39:16 +03:00
Daniel Rosenwasser 3dc78b6f3b
Merge pull request #30916 from jack-williams/array-elaboration
Elaborate array and tuple relation errors
2019-04-15 14:00:22 -07:00
Andrew 13d9f08976 Gracefully parse 'super' with type arguments (#10677) (#30913) 2019-04-15 13:06:29 -07:00
Jack Williams 2ea91a0e9c Elaborate array and tuple relation errors 2019-04-15 18:16:38 +01:00
Andrew Branch 28b21df943
Add period to compiler flag description to match others 2019-04-08 09:46:47 -07:00
Andrew Branch 2ee93bf0f2
Add allowUmdGlobalAccess flag 2019-04-08 09:46:46 -07:00
Alexander T 75a812b4db add new message - TS1258 (#30704) 2019-04-03 09:49:34 -07:00
Sheetal Nandi 35470b3f3b Make tsbuildInfoFile as commandline option to tsc (and not tsc -b) 2019-03-25 14:47:36 -07:00
BigAru 03f0f88101 add diagnostic messages 2019-03-24 16:52:23 +01:00
Sheetal Nandi 722afc18bb Fix typo 2019-03-21 09:01:52 -07:00
Sheetal Nandi 34c3233d18 Allow --incremental to be command line option 2019-03-20 14:48:47 -07:00
Gabriela Britto 1c8a359914
rename convert to named parameters (#30401) 2019-03-14 13:41:29 -07:00
Wenlu Wang d2476759e2 add related error span for default exports (#25396)
* add related error span for default exports

* accept baseline

* stash

* accept baseline and fix lint

* update testcase

* Add missing semicolon
2019-03-12 13:15:14 -07:00
Sheetal Nandi 68e28da141 Build project if existing project was built with different compiler version 2019-03-08 15:14:34 -08:00
Sheetal Nandi 990b199ebd Merge branch 'master' into incrementalBuildInfo 2019-03-08 11:42:19 -08:00
Sheetal Nandi fe9f42480a Handle error when type parameter of mapped type uses private type
Fixes #30201
2019-03-06 13:30:48 -08:00
Gabriela Britto d2364f555f
Merge pull request #30089 from Microsoft/convert-to-named-parameters
Convert to named parameters
2019-03-06 09:33:01 -08:00
Sheetal Nandi 223d42847b Merge branch 'master' into incrementalBuildInfo 2019-03-01 11:39:44 -08:00
Sheetal Nandi cd195c91c6 Add options tsBuildInfoFile to provide name for the buildinfo file 2019-03-01 10:28:57 -08:00
Sheetal Nandi df9da15abb Incremental false with composite not allowed 2019-03-01 09:39:58 -08:00
Sheetal Nandi d53efdf380 Changes to generation of .tsbuildinfo:
- If composite or incremental then only the .tsbuildinfo will be generated
- if --out or --outFile the file is outputFile.tsbuildinfo
- if rootDir and outDir then outdir/relativePathOfConfigFromRootDir/configname.tsbuildinfo
- if just outDir then outDir/configname.tsbuild
- otherwise config.tsbuildinfo next to configFile
2019-02-28 13:46:26 -08:00
Anders Hejlsberg 237c33b444
Merge pull request #30109 from Microsoft/circularConstraintErrors
Consistently error on circular constraints
2019-02-28 10:57:01 -10:00
Gabriela Araujo Britto 617d5af67e add diagnostics message for refactor description 2019-02-28 11:22:05 -08:00
Sheetal Nandi ed35741b5f Merge branch 'master' into incrementalBuildInfo 2019-02-27 15:45:59 -08:00
Nathan Shively-Sanders be2db9db12
Add globalThis (#29332)
* Restore original code from bind-toplevel-this

With one or two additional comments

* Working in JS, but the symbol is not right.

Still need to

1. Make it work in Typescript.
2. Add test (and make them work) for the other uses of GlobalThis:
window, globalThis, etc.

* Check in TS also; update some tests

Lots of tests still fail, but all but 1 change so far has been correct.

* Update baselines

A couple of tests still fail and need to be fixed.

* Handle type references to globalThis

The type reference must be `typeof globalThis`. Just `globalThis` will
be treated as a value reference in type position -- an error.

* Restore former behaviour of implicitThis errors

I left the noImplicitThis rule for captured use of global this in an
arrow function, even though technically it isn't `any` any more --
it's typeof globalThis.  However, you should still use some other method
to access globals inside an arrow, because captured-global-this is super
confusing there.

* Test values with type globalThis

I ran into a problem with intersecting `Window & typeof globalThis`:

1. This adds a new index signature to Window, which is probably not
desired. In fact, with noImplicitAny, it's not desired on globalThis
either I think.
2. Adding this type requires editing TSJS-lib-generator, not this repo.

So I added the test cases and will probably update them later, when
those two problems are fixed.

* Add esnext declaration for globalThis

* Switch to symbol-based approach

I decided I didn't like the import-type-based approach.

Update baselines to reflect the difference.

* Do not suggest globals for completions at toplevel

* Add tests of element and property access

* Look up globalThis using normal resolution

globalThis is no longer constructed lazily. Its synthetic Identifier
node is also now more realistic.

* Update fourslash tests

* Add missed fourslash test update

* Remove esnext.globalthis.d.ts too

* Add chained globalThis self-lookup test

* Attempt at making globalThis readonly

In progress, had to interrupt for other work.

* Add/update tests

* Addres PR comments:

1. Add parameter to tryGetThisTypeAt to exclude globalThis.
2. Use combined Module flag instead combining them in-place.
3. SymbolDisplay doesn't print 'module globalThis' for this expressions
anymore.
2019-02-27 14:14:34 -08:00
Anders Hejlsberg ede6b9a5cb Issue errors for all circular type parameter constraints 2019-02-26 12:39:01 -08:00
Sheetal Nandi e1b18ab5fb Merge branch 'master' into incrementalBuildInfo 2019-02-22 14:19:53 -08:00
Sheetal Nandi 494bd92f1b Report error if overwriting buildInfo of another project reference 2019-02-21 19:34:20 -08:00
Sheetal Nandi 89c4c4f684 Update the message to not just mean javascript since we might need to regenerate .d.ts as well 2019-02-21 17:52:15 -08:00
Daniel Rosenwasser 4a256abc8a Give a related span pointing to the implementation signature when reporting incompatibility. 2019-02-21 10:51:18 -08:00
Daniel Rosenwasser cee933ff09 Be more specific in errors. 2019-02-21 10:50:14 -08:00
Sheetal Nandi a881391dc9 Merge branch 'master' into incrementalBuildInfo 2019-02-20 10:37:44 -08:00
Sheetal Nandi b958f1c8b5 Merge branch 'master' into incrementalBuildInfo 2019-02-14 12:19:10 -08:00
Titian Cernicova-Dragomir 950861ec7f Improve error message for using value as type. 2019-02-13 17:25:23 +02:00
Sheetal Nandi ab7d65e01f Merge branch 'master' into usePrependToSkipBuild 2019-02-07 10:39:41 -08:00
Kagami Sascha Rosylight a8823f5169
Merge branch 'master' into es2019 2019-02-07 10:08:26 +09:00
Sheetal Nandi 87bb6c9c90 Merge branch 'master' into usePrependToSkipBuild 2019-02-04 15:43:44 -08:00
Sheetal Nandi aa5d62a72c Perform only emit on js file if no decl file change 2019-02-04 15:01:54 -08:00
Alan Pierce 942b020081 Merge remote-tracking branch 'origin/master' into enforce-const-enum-access-for-isolatedmodules 2019-02-01 18:52:22 -08:00
Sheetal Nandi 03fa5bd90f Merge branch 'master' into usePrependToSkipBuild 2019-01-31 22:05:51 -08:00
Klaus Meinhardt 782622f9cd clarify error message for 'readonly' type operator 2019-01-31 19:44:49 +01:00
Sheetal Nandi bd769406ca If the project only needs prepend output to be changed, prepare to just manipulate output
Step 1: Update the verbose log to reflect it
2019-01-31 10:24:12 -08:00
Klaus Meinhardt f4747f4667 Merge branch 'master' of github.com:Microsoft/TypeScript into add-to-types2 2019-01-31 11:25:01 +01:00
Anders Hejlsberg 08fe06f527 Merge branch 'master' into constContexts
# Conflicts:
#	src/compiler/checker.ts
2019-01-29 12:29:30 -08:00
Anders Hejlsberg ea3814676d Error on union types that are too complex to represent 2019-01-28 13:11:04 -08:00
Anders Hejlsberg 4706a060a5 Merge branch 'master' into readonlyArrayTuple 2019-01-26 14:44:15 -08:00
Alan Pierce a60795f04a Merge remote-tracking branch 'origin/master' into enforce-const-enum-access-for-isolatedmodules
This changes the new error code from TS2739 to TS2748.
2019-01-25 09:19:12 -08:00
Klaus Meinhardt 6eb83650ea Merge branch 'master' into add-to-types2 2019-01-25 16:56:11 +01:00
Ryan Cavanaugh 1a742e6f27
Merge pull request #27918 from collin5/b27914
Improve error message for duplicate property with computed name
2019-01-24 14:35:51 -08:00
BigAru 52e94d2b80 Merge remote-tracking branch 'upstream/master' into m-lambda-to-fn 2019-01-22 05:10:32 +01:00
Anders Hejlsberg ec30c20ec9 Validate const assertion operand 2019-01-19 10:25:41 -08:00
Sheetal Nandi 9bd23652ef
Merge pull request #29161 from Microsoft/incrementalBuild
Supports incremental build in tsc --b --w mode
2019-01-17 13:44:48 -08:00
rflorian 8a048159ba
Merge branch 'master' into add-codefix-cannot-find-name-in-for-loop 2019-01-17 00:07:43 +01:00
Anders Hejlsberg 2256f9159f Fix typo 2019-01-16 09:46:02 -08:00
Kagami Sascha Rosylight d8ac9ba414
Merge branch 'master' into es2019 2019-01-16 10:54:46 +09:00
Daniel Rosenwasser adb4738cff
Merge pull request #28132 from a-tarasyuk/feature/28086
28086 - "--downlevelIteration errors should mention using later targets"
2019-01-15 14:06:57 -08:00
Wesley Wigham 49689894d7
Elaborate jsx children elementwise (#29264)
* Heavy WIP, but has good contextual typing fix

* Add arity error, refine messages and spans

* Small error message change

* Better error messages, text-specific message
2019-01-15 11:32:36 -08:00
Anders Hejlsberg bb8378fddf Support 'readonly' type modifier on array and tuple types 2019-01-15 09:43:39 -08:00
Gabriela Britto e5708e1903
Merge pull request #29352 from Microsoft/qualified-name-param-tag-error
Qualified name param tag error
2019-01-14 10:28:08 -08:00
Alexander ba94fd9e05 Merge branch 'master' of https://github.com/Microsoft/TypeScript into feature/28086 2019-01-12 08:39:06 +02:00
Sheetal Nandi c1edbb8522 Merge branch 'master' into incrementalBuild 2019-01-11 14:34:45 -08:00