Daniel Rosenwasser
3517af8f80
Make 'getIndentString' just use a loop. ( #41221 )
...
* Make 'getIndentString' just use a loop.
* Added test.
* Accepted baselines.
2020-10-26 12:19:31 -07:00
Anders Hejlsberg
d1f87d18b1
Support partial reverse mapped inferences with tuple types ( #41106 )
...
* Support partial reverse mapped inferences with tuple types
* Add tests
* Accept new baselines
2020-10-22 11:27:41 -07:00
Andrew Branch
1f852ed747
Percent-encode source map URLs ( #41102 )
2020-10-20 13:11:52 -07:00
Wesley Wigham
b8dfa28ca8
Do not consider empty jsx expressions semantically important children
2020-10-19 13:34:16 -07:00
Anders Hejlsberg
3918e6c535
Move anonymous type instantiation cache from AST node to root type ( #41084 )
...
* Move anonymous type instantiation cache from AST node to root type
* Use "root" type reference as cache location for deferred type references
* Add test
Co-authored-by: Andrew Branch <andrew@wheream.io >
2020-10-19 07:26:48 -07:00
Wesley Wigham
ce1947b0be
Merge pull request #41070 from weswigham/use-minimal-endings-in-bundled-declaration-emit
...
Use minimal endings when generating declarations for js
2020-10-14 15:29:50 -07:00
Eli Barzilay
5b2fba3334
transformGenerators: handle CommaListExpression
...
Uses essentially the same code as `visitCommaExpression` (which was
moved, to keep both together and close to
`visit{Right,Left}AssociativeBinaryExpression`).
Fixes #40614 .
2020-10-14 15:58:13 -04:00
Wesley Wigham
84726be01a
Merge pull request #40597 from weswigham/allow-instanceof-array-to-narrow-readonly-array
...
Handle the mapping between Array and ReadonlyArray in isTypeDerivedFrom
2020-10-13 15:08:17 -07:00
Wesley Wigham
1cdb621257
Use minimal endings when generating declarations for js
2020-10-12 16:01:32 -07:00
Andrew Branch
a09a7144e7
Fix crash resolving ImportTypeNode in JSDoc ( #40838 )
2020-10-12 09:33:39 -07:00
Wesley Wigham
39c2a09b1f
Fix crash due to unchecked cast in addImplementationSuccessElaboration
2020-10-09 10:53:59 -07:00
Wesley Wigham
a49099fd15
Add elaboration when call fails all overloads but succeeds against the implementation signature
2020-10-08 14:55:14 -07:00
Nathan Shively-Sanders
cf3e28ea66
Revert "feat(40197): handle uncalled function checks in binary expressions ( #40260 )"
...
This reverts commit eaf4f46c17 .
2020-10-07 14:14:49 -07:00
Alex T
eaf4f46c17
feat(40197): handle uncalled function checks in binary expressions ( #40260 )
2020-10-07 14:06:42 -07:00
Mauro Bringolf
48ad25d4b9
Add currency sign to NumberFormatOptions type ( #40709 )
2020-10-06 16:30:09 -07:00
Daniel Rosenwasser
3766be1bde
Test indexed access to this on intersections ( #40967 )
...
* Added test.
* Accepted baselines.
2020-10-06 14:18:44 -07:00
Vincent Boivin
57661607e9
fix(40929) PromiseConstructor error message for newer versions of ECMAScript ( #40931 )
...
* Update package-lock.json
* Update package-lock.json
* Update package-lock.json
* Update package-lock.json
* Fixes #40929
Co-authored-by: TypeScript Bot <typescriptbot@microsoft.com >
2020-10-05 16:38:12 -07:00
Tiago Tristao
1191e2e731
Fix class expression from being assignable if types don't match ( #40660 )
...
* Fix class expression from being assignable if types don't match
* Fix class expression from being assignable if types don't match
2020-10-05 13:21:38 -07:00
Wesley Wigham
77df9faabf
Merge pull request #40886 from weswigham/error-on-anonymous-type-with-nonlocal-unique-symbol
...
Limit when we allow nested unique symbols to be serialized
2020-10-05 11:59:45 -07:00
Orta Therox
dd84bc1dc9
Handles creating a reasonable AST when destructuring into a parens'd expresssion ( #40115 )
...
* Handles creating a lgical AST when destructuring into a parens
* Adds an async example
2020-10-05 14:12:47 -04:00
Vincent Boivin
61aadc4ce2
fix(40320): Better errors when using properties/methods from newer versions of ECMAScript ( #40650 )
...
* Update package-lock.json
* Suggesting a library for a missing property/method
* Added more types and added tests
* Added more tests to cover all the latest features
* Added bigintarrays and dataview methods
* Fixed typo in template
* Transform old error message to use 2nd template slot
* Removed test that has been split up between es2015 and es2016+
* Use empty arrays and remove unnecessary function call
* merge
* Added early bail-out and updated baselines
* Implemented early bail-out (misread)
Co-authored-by: TypeScript Bot <typescriptbot@microsoft.com >
2020-10-02 16:47:37 -07:00
Richa Deshmukh
b748484031
#40763 Fixed: Bad error message when forgetting a comma in an array of templ… ( #40907 )
...
* #40763 Bad error message when forgetting a comma in an array of template strings
* Code review fixes
2020-10-02 15:37:59 -07:00
Wesley Wigham
b86dc34386
Limit when we allow nested unique symbols to be serialized to when their declaration is within the same file as the context
2020-10-01 15:20:01 -07:00
Wesley Wigham
e9465c5de5
Properly compare path prefixes when generating module paths
2020-10-01 14:56:32 -07:00
Wesley Wigham
b93da6291a
Emit non-identifier enum member references as typeof parent[some name] ( #40679 )
2020-10-01 13:06:17 -07:00
Wesley Wigham
a91c2879ef
Allow discrimination to identical object types when discriminating contextual types ( #40574 )
...
* Merge identical object types when discriminating contextual types
Co-authored-by: Orta <ortam@microsoft.com >
* Allow identical discriminants when discriminating, rather than trying to unify identical union members
* Fix lint
Co-authored-by: Orta <ortam@microsoft.com >
2020-09-23 00:51:14 -07:00
uhyo
61910e8c97
Fix missing constraints for parenthesized infer T ( #40406 )
...
* add tests
* consider parenthesized types in getInferredTypeParameterConstraint
* update tests
2020-09-23 00:48:40 -07:00
Wesley Wigham
10b240cde3
Allow an infer type node to resolve its own name ( #40483 )
2020-09-22 21:21:13 -07:00
Andrew Branch
735a67a05e
Fix iterable contextual type ( #40592 )
2020-09-17 10:42:47 -07:00
Wesley Wigham
081f98232b
Handle the mapping between Array and ReadonlyArray in isTypeDerivedFrom
2020-09-16 13:31:13 -07:00
Wesley Wigham
98314d77e8
Use unexpanded parameter list in serialization when the expanded list has a non-trailing variadic position ( #40556 )
2020-09-14 19:56:24 -07:00
Wesley Wigham
94123d5744
Issue a diagnostic when the node builder performs truncation despite the NoTruncation flag being set ( #40477 )
2020-09-14 12:20:57 -07:00
Andrew Branch
9c8d11b5ed
Allow 'paths' without 'baseUrl' ( #40101 )
...
* Allow paths without baseUrl
* Remove exception for leading * paths
* Add comment, remove commented code
* Update baselines
* Remove unnecessary default
* Fix test harness
* Fix baseline
* Resolve relative to host.getCurrentDirectory() with createProgram API
2020-09-11 12:58:40 -07:00
Orta Therox
aa2756a5d7
Updates Dom lib with TSJS changes, adding a new library for webworker iterable ( #40500 )
...
* Updates Dom lib with TSJS changes, adding a new library for webworker iterable
Co-authored-by: Nathan Shively-Sanders <nathansa@microsoft.com >
* Fixes tests
Co-authored-by: Nathan Shively-Sanders <nathansa@microsoft.com >
2020-09-11 15:36:00 -04:00
Orta Therox
cdafb7157b
Replaces the default module index resolver with '/index' instead of '' when handling internal routing for dts bundles ( #39277 )
...
* Adds support for declaring the bundled name of a dts module export
Co-authored-by: Wesley Wigham <wwigham@gmail.com >
* Adds baselines
* Update the tests
* Try to reduce the scope of the bundledPackageName error
* Use the flag in more baselines
* Get it green
* More tests
* Handle more feedback
* More test cleanup
* Set the moduleResolution for the tsconfigs
Co-authored-by: Wesley Wigham <wwigham@gmail.com >
2020-09-11 08:12:07 -04:00
Orta Therox
fa89ce6158
Remove assignability cases in getNarrowedType + an isArray improvement for readonly arrays ( #39258 )
...
* Explore using a different isArray declaration
* Add tests and the new isArray definition
* Baseline updates
* Upda the isArray type
2020-09-08 14:43:48 -04:00
Wesley Wigham
7838b0172a
Add errors when providing type arguments for intrinsic JSX tags ( #40293 )
2020-09-08 10:29:15 -07:00
Wesley Wigham
e5fd0dd1e3
Allow private symbols to be control flow narrowed ( #39978 )
...
* Allow private symbols to be control flow narrowed
* Add test with narrowing of inferred control flow type for completeness
* Reformat long line
2020-09-05 02:48:45 -07:00
Eric Anderson
79f919e8f5
Fixes stack overflow when exporting a lot in commonjs ( #38994 )
...
* Fixes stack overflow when exporting a lot in commonjs
Fixes #38691
* Add missing test files
2020-09-04 09:01:59 -07:00
Alexander T
01362a3ac1
feat(part of 40169): add spelling suggestion/quick fix for module/namespace exported members ( #40211 )
2020-08-29 01:01:06 -07:00
Eli Barzilay
746bdb7946
Fix getContextualTypeForBindingElement for arrays
...
When handling an array type, the lookup should use the position index
instead of the identifier name.
Also uncomment the tests in the `staticFieldWithInterfaceContext.ts`
test which failed because of this bug.
Fixes #40158 .
2020-08-26 16:28:50 -04:00
Alexander T
2dd7a4bf93
fix(31046): add new diagnostic message for incompatible constructor signature ( #40073 )
2020-08-22 13:26:13 -07:00
Alexander T
9569198df6
fix(25770): add diagnostic message for the possible mapped type used as an index ( #39973 )
2020-08-21 10:42:48 -07:00
Alexander T
6ec3629ef4
fix(26325): use a unique name for reserved words in 'constructor like' function name ( #39684 )
2020-08-21 09:47:37 -07:00
Eli Barzilay
f9e360d44b
Add missing contextual type to static PropertyDeclarations
...
Makes it possible to type class static fields.
Fixes #33897 .
2020-08-20 19:12:55 -04:00
Andrew Branch
dbab46c363
The falsy part of any/unknown is any/unknown ( #39529 )
2020-08-18 11:06:44 -07:00
Wesley Wigham
f9cca25cd7
Fix lack of error on default export of nonexistant name ( #40094 )
...
* Modify test harness so it can report underlying issue, fix small parent pointer issue
* Fix underlying export asignment check issue and fix lints
* Ensure class/function duplicate declaration errors are reported regarless of which is encountered first
* Ensure flag conflict errors are reported regardless of which declaration is encountered first
2020-08-17 15:30:19 -07:00
Anders Hejlsberg
cd30534327
Recursive conditional types ( #40002 )
...
* Support recursive conditional types
* Accept new API baselines
* Accept new baselines
* Simplify recursive type tracking in type inference
* Accept new baselines
* Add tests
* Accept new baselines
* Revise recursion tracking in type inference
* Revise tests
* Accept new baselines
* Add more tests
* Accept new baselines
2020-08-15 18:22:30 -07:00
Ron Buckton
fca9f451d8
Add missing 'importName' for private field helpers ( #39932 )
2020-08-06 13:27:19 -07:00
Nathan Shively-Sanders
d3877d294c
Redo in narrowing for intersections ( #39637 )
...
* Redo in-narrowing for intersections
Still need to carve out an exception for globalThis
* exempt globalThis from `in` narrowing
2020-07-30 14:58:22 -07:00