2844 Commits

Author SHA1 Message Date
Wesley Wigham
7b5975382f
Use same condition in isReferencedAliasDeclaration as isAliasResolvedToValue (#28171) (#28219) 2018-10-30 11:19:05 -07:00
Andy
ca6e2e7bb1
Fix bug: Ensure JSDoc type range is valid (#27343) (#28008)
* Fix bug: Ensure JSDoc type range is valid

* Have scanJsDocToken scan keywords (#27162)

* Have scanJsDocToken scan keywords

* Update API

* Add 'no-unnecessary-type-assertion' tslint disables
2018-10-24 11:05:56 -07:00
Wesley Wigham
fc1abbbabe
Fix non-selfclosing JSX tag contextual types (#27251) (#27314) 2018-09-24 13:51:07 -07:00
Wesley Wigham
dd9d5d1398
Limit the narrow-to-fresh rule added with boolean literals to only boolean literals (#27274) (#27319)
* Remove the narrow-to-fresh rule added with boolean literals

* Revert "Remove the narrow-to-fresh rule added with boolean literals"

This reverts commit 9f96fe5da33f9297157b326c37680a964b23d7eb.

* Only apply freshness to booleans for now

* Add largeish example from issue

* Should be AND not OR

* Add minor improvements suggested by @ahejelsberg

* Reorder conditional a bit
2018-09-24 13:51:00 -07:00
Ryan Cavanaugh
d715d835c6
Merge pull request #27254 from weswigham/port-distribution-fix
Distribute indexes of indexed access types first (#27243)
2018-09-21 13:25:40 -07:00
Wesley Wigham
317b2c2a74
Distribute indexes of indexed access types first (#27243) 2018-09-20 17:13:35 -07:00
Wesley Wigham
93f6b73c8c
Set parent pointers on manufactured reference for property initialization check (#27246) 2018-09-20 16:54:46 -07:00
Sheetal Nandi
7852cf7ed3
Merge pull request #27175 from a-tarasyuk/bug/error-using-declaration-dir-with-composite
#26862: allow using declarationDir with composite option
2018-09-18 10:53:38 -07:00
Alexander T
d11117829d allow using declarationDir with composite option 2018-09-18 14:38:48 +03:00
Alexander T
c510df1a53 deny using allowJs option with composite 2018-09-18 12:41:30 +03:00
Wesley Wigham
f6321bf6d5
Elaborate into arrow return expressions and array types (#27040)
* Dive into simple arrow functions when elaborating errors

* Dive into array literals as though they were tuples when elaborating, if possible

* Make parameter required

* Remove misleading errors by deeply tuplefying

* Remove lib related spans
2018-09-17 16:45:54 -07:00
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