2653 Commits

Author SHA1 Message Date
Elizabeth Dinella
13734e7d68
Fix for issue #6154 - overriding methods with properties in the derived class (#24343)
* Fix to issue 6154 - Overriding a method with a property in the derived class should not cause a compiler error

* new baselines

* fixed deleted baselines
2018-05-24 14:12:13 -07:00
Andy
5983c45e24
Fix typo: seperate -> separate (#24338)
* Fix typo: seperate -> separate

* update tests
2018-05-23 09:36:17 -07:00
Wesley Wigham
0102f8050c
Check for keyof constraint type instead of syntactic check (#24098)
* Check for keyof constraint type instead of syntactic check

* Readopt older candidateType check, even though it shouldnt really matter

* OK. Just use maybetypeOfKind

* Remove redundant boolean check
2018-05-22 16:58:31 -07:00
Wesley Wigham
8b8cd31784
Use unknown serialization kind when type symbol isnt resolved (#24332)
* Use unknown serialization kind when type symbol isnt resolved

* Add test for the isolated modules case
2018-05-22 16:56:12 -07:00
Wesley Wigham
3fe946df78
Use symbolToTypeNode for class & interface references (#24330)
* Use merged symbols when calculating qualification, use symbolToTypeNode

* Accept baselines
2018-05-22 14:09:45 -07:00
Andy
982c8d0af9
Add suggestion diagnostics for unused label and unreachable code (#24261)
* Add suggestion diagnostics for unused label and unreachable code

* Always error on unused left hand side of comma
2018-05-22 07:56:29 -07:00
Andy
802dc2bb9b
fixUnusedIdentifier: If every VariableDeclaration is unused, remove the VariableStatement (#24231) 2018-05-21 15:54:33 -07:00
Wesley Wigham
02fe840732
Get constraint with this argument of the type parameter for comparisons (#21210)
* Get constraint with this argument of the type parameter for comparisons

* Also instantiate indexed accesses

* Add much simpler test
2018-05-18 18:30:23 -07:00
Wesley Wigham
3800d7b246
More robust circularity detection in node builder (#24225) 2018-05-17 14:30:07 -07:00
Anders Hejlsberg
3fc3df3c3a
Merge pull request #24137 from Microsoft/fix23977
Optimize intersections of unions of unit types
2018-05-17 13:15:28 -07:00
Wesley Wigham
3fc727b256
Use import types to refer to declarations in declaration emit (#24071)
* Stand up a simple implementation using import types for exports of modules which are otherwise inaccessible

* Ensure references exist to link to modules containing utilized ambient modules

* Accept baselines with new import type usage

* Fix lint
2018-05-17 13:08:22 -07:00
Mohamed Hegazy
8dc9b76b6d Add undefined guard 2018-05-17 11:45:34 -07:00
Wesley Wigham
60df4671d0
Fix jsx element parsing within ternary (#24149) 2018-05-16 09:28:22 -07:00
Andy
2200c94a43
Fix unused diagnostic for rename-destructuring { a: b } (#24145) 2018-05-15 16:22:13 -07:00
Sheetal Nandi
77168e5d50
Merge pull request #24112 from Microsoft/packageJsonWithMainInSubDirectory
Resolve using package json's "main" field when resolving typescript extensions
2018-05-15 14:18:27 -07:00
Anders Hejlsberg
1c3dbd4f4b Add regression test 2018-05-15 12:34:29 -07:00
Sheetal Nandi
7be85958a1 Add test for module resolution with package json containing main field referencing js file in sub directory 2018-05-14 13:06:34 -07:00
Wesley Wigham
ba4bf21ead
Cache simplified indexed accesses to better handle circularly constrained indexed acceses (#24072) 2018-05-14 12:54:26 -07:00
Wesley Wigham
b58e4e1fa1
Reduce aggression of parenthesis removal in ts transform (#24073) 2018-05-14 11:20:04 -07:00
Wesley Wigham
6149b41469
Generate names for type parameter declarations in inferred types (#23902)
* Generate names for type parameter declarations in inferred types

* Fix lint

* Merge functions, make overload private

* Handle some edge cases better (nodes in differing files than current emit)

* Account for transformed nodes
2018-05-10 11:16:27 -07:00
Nathan Shively-Sanders
e27fb0651b
Fix crash in recursive declared type resolution (#23950)
When one type has a type parameter with a default
2018-05-09 09:25:00 -07:00
Andy
5725428f2d
fixUnusedIdentifier: Handle destructure with all bindings unused (#23805)
* fixUnusedIdentifier: Handle destructure with all bindings unused

* Add parameters test

* Add test for 'for' loop
2018-05-08 13:33:55 -07:00
Wesley Wigham
618da24d6a
Look at simplified types when checking distributive conditional constraints (#23884) 2018-05-04 14:35:39 -07:00
Sheetal Nandi
5133c70e7e
Merge pull request #22167 from Microsoft/requireJson
Resolve the modue names with "modulename.json" to json files when doing node module resolution
2018-05-04 12:42:10 -07:00
Sheetal Nandi
15f9ea3d14 Merge branch 'master' into requireJson 2018-05-03 15:35:54 -07:00
Ron Buckton
f67afa098f Unpatch vfs resolver and default lib rename 2018-05-03 14:18:50 -07:00
Wesley Wigham
eb80e9a51c
node builder should strive to preserve mapped type keyofness (#23815) 2018-05-03 12:38:31 -07:00
Wesley Wigham
23b9a23455
Ensure properties with computed names are visited (#23787) 2018-05-03 11:21:29 -07:00
Wesley Wigham
19a985eb24
Dont consider global augmentation top-level members as having the export modifier (#23846)
* Dont consider global argumentation top-level members as having the export modifier

* Remove unneeded test parts from repro
2018-05-03 11:21:11 -07:00
Wesley Wigham
b467cd8a99
Move property errors to the name for the error span (#23865) 2018-05-03 10:55:44 -07:00
Wesley Wigham
41182c2f0b
Stop using circularity-unchecked-caching (#23808)
* Stop using circularity-unchecked-caching

* Add comment
2018-05-03 10:44:17 -07:00
Ron Buckton
56648ad0f1
Merge pull request #20763 from Microsoft/vfs
Update harness to use single robust virtual file system for tests.
2018-05-03 10:25:20 -07:00
Wesley Wigham
9c40d276ab
Downlevel destructuring in module transformer if destructured variable has multiple names (#23832)
* Downlevel destructuring in module transformer if destructured variable has multiple names

* Alter indentation
2018-05-02 16:20:47 -07:00
Wesley Wigham
b5b7fc4f1d
Flag default imports with named imports as needing importStar (#23795)
* Flag default imports with named imports as needing importStar

* Restructure helpers a bit, add double-default testcase
2018-05-02 16:20:34 -07:00
Ron Buckton
d62a11ffc0 Merge branch 'master' into vfs 2018-05-01 18:58:31 -07:00
Wesley Wigham
c663645c91
Inform getDeclarationSpaces about how an imported exportAssignment may merge (#23816) 2018-05-01 17:24:30 -07:00
Wesley Wigham
0c244d86b3
Add used-before-declaration errors for class refs inside computed names (#23784) 2018-04-30 12:55:30 -07:00
Mohamed Hegazy
2c956af927
Merge pull request #23664 from a-tarasyuk/feature/strictPropertyInitialization-can-not-be-used-without-strictNullChecks
Add warn that user can not use --strictPropertyInitialization without --strictNullChecks
2018-04-30 12:10:54 -07:00
Sheetal Nandi
579748bc2b Merge branch 'master' into requireJson 2018-04-30 11:44:09 -07:00
Anders Hejlsberg
0dc42fea74 Add regression tests 2018-04-30 10:43:55 -07:00
Wesley Wigham
8c5ad2429a
Relax switch-case narrowing restrictions (#23522)
* Allow switch case narrowing even when individual clauses are nonunit

* And remove unit type restriction

* Rename
2018-04-27 16:30:43 -07:00
Wesley Wigham
47385b29e0
Actually visit expression node on empty destructuring assignment (#23744) 2018-04-27 15:55:53 -07:00
Wesley Wigham
6d3b6e21da
Add implicit any errors for destructuring computed names which aren't late bound and have no corresponding index (#23489)
* Add implicit any errors for destructuring computed names which arent late bound and have no corresponding index

* Add string fallback for number

* Expand test case, make functionality mimic other (buggy) areas

* Add symbol name errors to bring in line with new indexing rules
2018-04-27 15:55:32 -07:00
Ron Buckton
4863d55d01 Merge branch 'master' into vfs 2018-04-27 14:03:42 -07:00
Wesley Wigham
d5ef1174bd
Copy consistient valueDeclarations on union/intersection symbols (#23190) 2018-04-27 13:12:35 -07:00
Alexander T
f04a18ae5b Add tests 2018-04-26 20:18:24 +03:00
Wesley Wigham
4a6888a850
There exist type parameters with symbols but without TypeParameterDeclaration nodes (#23690)
* There exist type parameters with symbols but without TypeParameterDeclaration nodes

* Add test
2018-04-25 15:53:06 -07:00
Ron Buckton
bb26ab5556 Merge branch 'master' into vfs 2018-04-23 22:48:48 -07:00
Nathan Shively-Sanders
905f9a02ad
module.exports = Entity is an alias, just like export = Entity (#23570)
* Make `module.export =` an alias like `export=` is

This breaks a couple of tests for previous workarounds. Fix in upcoming
commits.

* Basically fixes all the breaks, but needs cleanup

* More notes to myself

* Clean up TODOs

* Call mergeSymbolTable and delete export= afterward

instead of basically copying the code myself.

* More cleanup

* Remove unnecessary check in import type checking

* Revert to DIY code.

It is more correct and will go away in a few days.

* Exported class expressions can be used as type

In both JS and TS

* Do not require named class expressions
2018-04-23 15:24:31 -07:00
Anders Hejlsberg
0179d97403
Merge pull request #23592 from Microsoft/improveIndexTypes
Support number and symbol named properties with keyof and mapped types
2018-04-23 13:22:56 -07:00