2833 Commits

Author SHA1 Message Date
Ryan Cavanaugh
ba76a8412f
Merge pull request #26935 from ajafff/abstract-baseclass-property
Error accessing abstract property in constructor of abstract subclass
2018-09-17 16:23:34 -07:00
Wesley Wigham
a55c0b7df9
Allow drawing inferences to conditional type branches (#27012)
* Allow drawing inferences to conditional type branches

* Fix lint
2018-09-17 15:19:23 -07:00
Wesley Wigham
c3b4f72498
Improve indexed access inferences (#27015) 2018-09-17 15:19:11 -07:00
Ryan Cavanaugh
a5326e68d0
Merge pull request #26866 from NMinhNguyen/allowSyntheticDefaultImports-if-esModuleInterop
Enable allowSyntheticDefaultImports if esModuleInterop is enabled
2018-09-17 15:03:28 -07:00
Wesley Wigham
921863eb31
Use head message at top level of elaboration if elaborating via possible call (#27107)
* Use head message at top level of elaboration if elaborating via possible call

* Accept updated baseline
2018-09-15 13:24:22 -07:00
Wesley Wigham
20eafb5b74
Introduce boolean literal freshness (#27042) 2018-09-14 15:00:09 -07:00
Wesley Wigham
4eb59a2d77
Fixing react defaultize+generic default props interaction (#27088)
* Add repro for fixed issue

* Fix JSX propagating flags and contextual types

* Accept slightly changed baselines

* Add modern react.d.ts and regression test
2018-09-14 14:18:47 -07:00
Andy
ebfcc1b52d
Fix bug: Ignore @enum tag in TS (#27076) 2018-09-13 15:24:49 -07:00
Andy
1a69f78fba
Fix bug: Ensure export = symbol always has a valueDeclaration (#26973) 2018-09-13 12:53:46 -07:00
Wesley Wigham
d3463ce356
Avoid circularly resolving names when looking up type members using resolveName (#26924)
* Avoid circularly resolving names when looking up type members using resolveName

* Add comment
2018-09-12 17:16:34 -07:00
Nathan Shively-Sanders
2f8a646f8e
isExpandoFunctionDeclaration only checks values (#27052)
Previously it checked types too, which caused a crash because types
don't have valueDeclaration set. But expando functions can't export
types, only values.
2018-09-12 12:21:50 -07:00
Wesley Wigham
31374d21bf
Provide suggestions for common can-not-find-name errors (#27034) 2018-09-11 14:42:17 -07:00
Wesley Wigham
1c1379252e
Prefer elaborating on expressions which could be called to produce a correct type by suggesting such (#27016)
* Prefer elaborating on expressions which could be called to produce a correct type by suggesting such

* Pass relation through elaboration machinery
2018-09-11 14:11:31 -07:00
Daniel Rosenwasser
aa9230f313
Merge pull request #27020 from Kingwl/improve_accidentally_calling_type-assertion_expressions
improve Diagnostics for accidentally calling type-assertion expressions
2018-09-11 14:00:31 -07:00
王文璐
2cf2bbd5f7 improve test case and add related diagnostic 2018-09-11 16:20:38 +08:00
王文璐
6b2ea463b2 improve Diagnostics for accidentally calling type-assertion expressions 2018-09-11 14:35:01 +08:00
Wesley Wigham
e9c6d967f6
Add related span pointing at missing arguments (#27013) 2018-09-10 16:40:33 -07:00
Wesley Wigham
f8b6a8fc8d
Introduce literal freshness for literal enum member types (#26556)
* Introduce literal freshness for literal enum members, allow enum references in ambient const initializers

* Merge statements

* Add enum literal readonly property test case

* Accept better baselines post-merge
2018-09-07 12:09:07 -07:00
Daniel Rosenwasser
cf2f339a5c
Merge pull request #26895 from Microsoft/callableErrors
Find first callable/constructable type in union when appropriate
2018-09-07 00:06:11 -07:00
Ryan Cavanaugh
8f654f0f1e
Merge pull request #21957 from jack-williams/typeof-in-switch
Fix #2214. Support narrowing with typeof in switch condition.
2018-09-06 10:46:13 -07:00
Sheetal Nandi
ddba6d8a70
Merge pull request #26825 from Microsoft/resolveJsonModuleEmit
Support json module emit when module emit is commonjs, amd, es2015 or esnext
2018-09-06 09:57:47 -07:00
Sheetal Nandi
8b30ff8393
Merge pull request #26817 from Microsoft/resolvingJsonModuleLikeJsExportsEqual
Use widened type and non fresh type when resolving json module
2018-09-06 09:49:53 -07:00
Jack Williams
911c59f47f Merge branch 'master' into typeof-in-switch 2018-09-06 09:33:01 +01:00
Wesley Wigham
d8f736d319
Change typeof narrowing to narrow selected union members (#25243)
* For typeof narrow all union members prior to filtering

* Revise narrowTypeByTypeof to both narrow unions and applicable union members

* Add repros from issue
2018-09-06 00:41:09 -07:00
Klaus Meinhardt
c203c27f00 Error accessing abstract property in constructor of abstract subclass
Fixes: #26411
2018-09-06 08:52:53 +02:00
Ryan Cavanaugh
54f7666017
Merge pull request #26453 from ajafff/abstract-property-in-initializer
disallow abstract property access in property initializer
2018-09-05 17:43:21 -07:00
Daniel Rosenwasser
d989e10c49 Renamed test. 2018-09-05 15:11:48 -07:00
Wesley Wigham
0b1183a461
Allow isSymbolAccessible to paint object literal declarations as visible (#24668)
* Dont use resolveEntityName for computed property name symbol resolution - use checkExpression and resolvedSymbol instead

* Fix lint
2018-09-05 14:52:47 -07:00
Wesley Wigham
69c7e67c88
Check privateness when emittign readonly/const props (#26920) 2018-09-05 13:49:38 -07:00
Ryan Cavanaugh
69f91b5ed8
Merge pull request #26837 from mattmccutchen/issue-26835
Argument arity error should only consider signatures with correct type argument arity.
2018-09-05 12:22:48 -07:00
Ryan Cavanaugh
4717ddb986
Merge pull request #26828 from Microsoft/narrowUnknownByObject
Narrowing unknown by typeof object to object | null
2018-09-05 12:16:24 -07:00
Ryan Cavanaugh
c188864394
Merge pull request #26112 from rhys-vdw/22685-array-flat-fix
Fix issue with Array#flatMap callback return type
2018-09-05 11:55:42 -07:00
Ryan Cavanaugh
4975dc85b1
Merge pull request #25822 from Kingwl/rechabilityImprove
improve enum rechability check
2018-09-05 11:46:07 -07:00
Wesley Wigham
62d8b85f1d
Allow literal initializers of readonly properties in declaration files (#26313)
* Allow literal initializers of readonly properties in declaration files

* Move some conditions a bit
2018-09-05 11:30:05 -07:00
Wesley Wigham
4ac8976750
Always check index type validity for all types when an error node is present so we always issue an error (#26789)
* Always check index type validity for all types when an error node is present so we always issue an error

* Change type a bit
2018-09-04 16:00:28 -07:00
Wesley Wigham
ca662419e8
Dont consider export specifiers visible in their local scope (#26884) 2018-09-04 16:00:10 -07:00
Wesley Wigham
f1370ecd54
Allow special assignments to have a contextual type of their declared type if present (#26802)
* Allow special assignments to have a contextual type of their declared type if present

* Expand change to cover all js special assignments

* Remove extraneous line
2018-09-04 15:58:18 -07:00
Daniel Rosenwasser
3d812ef93a Added test. 2018-09-04 11:07:50 -07:00
Minh Nguyen
aaa723e2d2 Enable allowSyntheticDefaultImports if esModuleInterop is enabled
Fixes #26193.
2018-09-04 11:07:29 +01:00
Matt McCutchen
f2d26fd0bb Argument arity error should only consider signatures with correct type
argument arity.

Fixes #26835.
2018-09-01 19:48:47 -04:00
Sheetal Nandi
f1a179a314 Narrowing unknown by typeof object to object | null
Fixes #26327
2018-08-31 15:24:53 -07:00
Sheetal Nandi
e41dbcdccd Support json module emit when module emit is commonjs, amd, es2015 or esnext
Fixes #25755 and #26020
2018-08-31 14:05:14 -07:00
Sheetal Nandi
50ccd91263 Baseline the require of json file in js file 2018-08-31 14:04:30 -07:00
Nathan Shively-Sanders
c929e74310
Add [Constructor]Parameter types to lib.d.ts (#26243) 2018-08-31 07:46:16 -07:00
Sheetal Nandi
d5b7edba8a
Merge pull request #26751 from Microsoft/declarationEmitWithComposite
Correctly mark visibile nodes when declaration isnt explicitly turned on but composite is true
2018-08-29 22:55:01 -07:00
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
Anders Hejlsberg
c48c3632bd Update tests 2018-08-29 14:02:15 -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