Commit Graph

2781 Commits

Author SHA1 Message Date
Sheetal Nandi
38a85cfbf4 Add test to verify #26669 where declaration output is incorrect when declaration flag is not set explicitly in options 2018-08-29 16:14:55 -07:00
Andy
3931b72118 noUnusedLocals: Destructuring assignment is a write (#26365)
* noUnusedLocals: Destructuring assignment is a write

* Code review

* Clarify test
2018-08-28 11:43:45 -07:00
Anders Hejlsberg
ac0d5da631 Merge pull request #26679 from Microsoft/improveGetTypeOfExpression
Improve control flow analysis of type assertions
2018-08-27 18:30:16 -07:00
Wesley Wigham
0dbad04c3f Distribute indexed accesses when simplifying them (#26281)
* unknownify accesses

* Move to simplify to break less with fewer changes

* Accept baselines for now

* Always propegate any as an index type

* Fix flow control in the presence of simplifiable types

* Add spy repro from #25181

* Retain errorType when it is used as a marker for the lack of a constraint

* Small refinement

* Add new test

* Move most potentially recursive types from isIdenticalTo into structuredTypeRelatedTo to match the non-identity relations

* Fix nits

* Doesnt need to be undefineable at all
2018-08-27 13:32:01 -07:00
Anders Hejlsberg
0c759b8194 Add regression test 2018-08-25 18:25:14 -07:00
Anders Hejlsberg
09bc7505a7 Add regression test 2018-08-25 16:09:18 -07:00
Wesley Wigham
5e8b63cd1d Use context free expression types in evolving array checking and cache context free type (#26585)
* Use context free expression types in evolving array checking and cache context free type

* Simplify second test

* Low max depth a tad just so node 8 wont stack out

* By request make flow control a round number
2018-08-22 16:17:42 -07:00
Ron Buckton
1f8aa057f8 Merge pull request #26483 from Microsoft/fix20594
Ensure for-in loop variable is checked
2018-08-22 11:41:17 -07:00
Anders Hejlsberg
93c76cb617 Merge pull request #26558 from Microsoft/fixInfiniteConstraints
Fix infinite constraints
2018-08-21 17:24:42 -07:00
Anders Hejlsberg
db9c202b64 Add regression test 2018-08-21 16:17:14 -07:00
Anders Hejlsberg
6a81d4c129 Merge branch 'master' into fixInfiniteConstraints 2018-08-20 16:30:32 -07:00
Anders Hejlsberg
886a6d7473 Fix test 2018-08-20 16:23:09 -07:00
Anders Hejlsberg
88f7759d6b Add tests 2018-08-20 16:21:25 -07:00
Anders Hejlsberg
6262ac8b3d Add tests 2018-08-20 12:41:48 -07:00
Wesley Wigham
d433c6ed05 Track late bound names in binding patterns (#26336) 2018-08-17 16:30:01 -07:00
Anders Hejlsberg
178f792f18 Merge pull request #26340 from Microsoft/neverIndexedAccess
T[K] should be 'never' when T is 'never'
2018-08-15 16:07:11 -07:00
Ron Buckton
a901930723 Ensure for-in loop variable is checked 2018-08-15 16:03:28 -07:00
Sheetal Nandi
969b46e44b Merge pull request #26458 from Microsoft/pathMappingResultsToNodeModules
When path mapping results to file in node_modules, mark it as external library
2018-08-15 15:28:50 -07:00
Daniel Rosenwasser
dfef227b18 Merge pull request #26473 from Microsoft/doGlobalImplicitThisRight
Fix bad message for captured global 'this'.
2018-08-15 13:08:38 -07:00
Sheetal Nandi
b983da55fd Merge pull request #26457 from Microsoft/baseUrlPathMappingResolveJsonModule
Do not include json file unless --resolveJsonModule is specified
2018-08-15 11:43:01 -07:00
Nathan Shively-Sanders
2bfd919b6a Narrow on element access of literal (#26424)
* Narrow literal element accesses

This means that, for example, the tuple `[number, string?]` allows its
second element to be narrowed with element access:

```ts
export function f(pair: [number, string?]): string {
  return pair[1] ? pair[1] : 'nope';
}
```

* Update baselines

* Cleanup

* More cleanup

* Test dashes in property names

* More cleanup

* Delete undead code
2018-08-15 09:58:39 -07:00
Daniel Rosenwasser
dc1fbc24cd Updated test cases. 2018-08-14 23:02:08 -07:00
Sheetal Nandi
a32f62b310 Write tests to demonstrate how baseUrl + pathMapping to node_modules behaves 2018-08-14 16:26:41 -07:00
Sheetal Nandi
aa8f1e5b6a Test when module resolution because of path mapping takes to json file
Test for #26402
2018-08-14 16:23:07 -07:00
Andy
e8b72aa7d9 Error on accessing private property through destructuring assignment, and mark property used (#26381)
* Error on accessing private property through destructuring assignment, and mark property used

* Factor out getTypeOfObjectLiteralDestructuringProperty
2018-08-13 14:08:00 -07:00
Andy
ad63468ed5 noUnusedLocals: f(x = 1) does not use x (#26366) 2018-08-13 11:14:52 -07:00
Andy
46d3caab7c Don't error on destructure of private property with computed property syntax (#26360) 2018-08-10 15:11:04 -07:00
Sheetal Nandi
c8e10a9a66 Merge pull request #26296 from ajafff/modulenameresolver-cache
fix moduleNameResolver cache
2018-08-10 14:36:54 -07:00
Klaus Meinhardt
3469b62be6 review comments 2018-08-10 22:25:27 +02:00
Wesley Wigham
19e04b2cdb Dont use baseURL relative absolute paths in declaration emit, use absolute paths in bundle emit (#26341) 2018-08-10 12:54:45 -07:00
Andy
55a620c433 Don't crash on computed property in destructure (#26334) 2018-08-09 15:29:45 -07:00
Anders Hejlsberg
89a8b5094a Add test 2018-08-09 16:33:54 -04:00
Wesley Wigham
fce3d9f34d Check the ambientness of a symbol name before attempting to trim it (#26312)
* Check the ambientness of a symbol name before attempting to trim it

* Use find instead of forEach, remember to also exclude global augmentations
2018-08-09 13:20:37 -07:00
Wesley Wigham
f6af618ab9 Still generate signatures in SkipContextSensitive mode just to match on return types (#25937)
* Still generate signatures in SkipContextSensitive mode just to match on return types

* Add cache for context-free type of a signature node

* Accept post-merge baseline
2018-08-09 10:17:50 -07:00
Ryan Cavanaugh
6210b7db54 Merge pull request #26245 from Kingwl/fix-compiler-crash
fix compiler crash (#26209)
2018-08-08 11:12:16 -07:00
Andy
eaf0d59d35 Fix bug: symbol.valueDeclaration not guaranteed to be defined (#26267) 2018-08-07 12:13:45 -07:00
王文璐
639190d607 fix compiler crash (#26209) 2018-08-07 10:09:26 +08:00
Klaus Meinhardt
7299bceafb infer number index signature in JS object literals (#26221)
Fixes: #26208
2018-08-06 11:52:51 -07:00
Alexander T
37b9a6bca4 25840 - Add a more meaningful error message to the case when calling a public static method on an instance (#25922)
* add a more meaningful error message to the case when calling a public static method on an instance

* Fix tests
2018-08-06 10:24:48 -07:00
Wesley Wigham
fefc47fae3 Flag JS Literals and ignore assignments/accesses to invalid props, instead of adding an index (#25996)
* Remove index signatures from js literals, use an object flag to indicate errors should be ignored instead

* Add focused test on the keyof problem

* Fix fourslash test

* Reenable errors with noImplicitAny flag

* Also disable excess property checks outside of noImplicitAny mode for js literals

* Edit and move comments
2018-08-02 13:40:44 -07:00
Wesley Wigham
2edc47bc67 Fix decorated accessor emit (#26016) 2018-07-31 13:53:28 -07:00
Andy
d40d54984e Support deleting all unused type parameters in a list, and deleting @template tag (#25748)
* Support deleting all unused type parameters in a list, and deleting @template tag

* Support type parameter in 'infer'
2018-07-27 11:55:31 -07:00
Wesley Wigham
d590d5bd0c Remove extraneous const, fixing #25714 (#25982) 2018-07-26 14:43:00 -07:00
Wesley Wigham
d17efe69d1 Fix #25954 - Always retain export modifier if default modifier is present (#25974)
* Fix #25954 - Always retain export modifier if default modifier is present

* Also fix an issue with scope markers in ambient modules not affecting the modifiers required
2018-07-26 12:39:03 -07:00
Anders Hejlsberg
7b4d13c95c Merge pull request #25859 from Microsoft/optimizePrimitiveIntersections
Optimize creation of intersections of union types
2018-07-25 10:28:43 -07:00
Wesley Wigham
59854bbd55 Inspect all possible module paths when looking for the best one to create a specifier with (#25850)
* Inspect all possible specifier paths when looking for the best one

* Add missing secondary option from test
2018-07-24 13:56:21 -07:00
Anders Hejlsberg
303e08fc4f Add regression test 2018-07-21 12:31:24 -07:00
Anders Hejlsberg
b48910413a Add regression test 2018-07-19 18:29:30 -07:00
Klaus Meinhardt
99d123a72d add correct test 2018-07-20 00:30:11 +02:00
Daniel Rosenwasser
37277e86e6 Merge pull request #25752 from Microsoft/objectsAgainstArrays
Avoid elaborating object literals against array-likes
2018-07-18 15:29:47 -07:00