Wesley Wigham
ba797f2c50
Add flag to skip qualification check when symbol is already in the process of being qualified ( #21337 )
2018-01-24 12:37:45 -08:00
Nathan Shively-Sanders
a3387cc41f
Merge pull request #21328 from Lazarus535/master
...
Fixes #17080
2018-01-22 14:08:21 -08:00
Nathan Shively-Sanders
97fb0fd55f
Add semicolon to unused class member list
...
Turns out SemicolonClassElement is a specific kind for semicolons inside
a class. Having one of them with --noUnusedLocals on would crash the
compiler after the assert added in #21013 .
2018-01-22 12:59:53 -08:00
Stephan Ginthör
d11341820e
Fixes #17080
...
Fixed the two requested changes.
1) Deleting the file "pull_request_template.md"
2) Declaring functions in tests, instead of defining
2018-01-22 21:45:37 +01:00
Stephan Ginthör
5a87a94c59
Fixes #17080
...
https://github.com/Microsoft/TypeScript/issues/17080
Added testcases from the Github bugreport (all working as intended now).
Signed CLA.
2018-01-22 13:40:57 +01:00
Stephan Ginthör
18e1ac0306
Fixes #17080
...
Changes are in src/compiler.checker.ts only
The second arguments to the function "removeOptionalityFromDeclaredType" has been changed from "getRootDeclaration(declaration)" to "declaration".
2018-01-22 09:52:58 +01:00
Wesley Wigham
d4c36120cf
Make nonnull assertions and binding patterns apparent declared type locations ( #20995 )
...
* Use apparent type of original type to handle indexes
* Redo older fix causing new bug by extending getDeclaredOrApparentType instead of getTypeWithFacts
* Rename symbol
2018-01-19 16:06:42 -08:00
Nathan Shively-Sanders
eed85737b8
Merge pull request #21271 from Microsoft/infer-keyof-to-any-not-empty
...
Inference of string literals to keyof creates an object with props of type `any`, not `{}`
2018-01-19 13:35:22 -08:00
Anders Hejlsberg
f6c79a631c
Add regression test
2018-01-18 17:28:37 -08:00
Nathan Shively-Sanders
39fee67d8e
Merge pull request #21110 from jack-williams/strict-null-empty-destructuring
...
Fix #20873 : Enforce strictNullChecks for RHS of empty destructuring assignment
2018-01-18 14:24:50 -08:00
Andy
b5ae9de7ba
Add grammar error for const { ...a: b } = {}; ( #21267 )
...
* Add grammar error for `const { ...a: b } = {};`
* Fix bug: bring in forEachChild change from #21268
2018-01-18 10:57:35 -08:00
Nathan Shively-Sanders
f0b4018017
Infer:string literal->keyof creates any props not {}
2018-01-18 08:44:57 -08:00
Wesley Wigham
99d6b0d308
Actually get the apparent type of intersection members when calculating intersection apparent types ( #21133 )
...
* Actually get the apparent type of intersection members when calculating intersection apparent types
* Add nonjsx variant
* Fix nit
2018-01-17 15:20:09 -08:00
Benjamin Lichtman
8f6c516ef9
Merge pull request #21205 from uniqueiniquity/resolveTripleSlashReferencePaths
...
Fix Windows-style absolute paths in triple-slash directives
2018-01-17 12:31:46 -08:00
Andy
61fb845b87
Get packageId for relative import within a package ( #21130 )
...
* Get packageId for relative import within a package
* Code review
* Rename things and add comments
* Improve documentation
* Test for scoped packages
2018-01-17 11:14:03 -08:00
Ron Buckton
16b13fe449
Fix incorrect parenthesization logic for conditional expression branches
2018-01-16 15:17:04 -08:00
Anders Hejlsberg
64b3086f5e
Merge pull request #21157 from Microsoft/fixEmptyArrayInference
...
Fix empty array inference
2018-01-16 12:42:26 -08:00
Wesley Wigham
154c6141f1
Allow functions to be printed structurally in declaration emit even when they have symbols ( #21203 )
...
* Allow functions to be printed structurally in declaration emit even when they have symbols
* Implement CR feedback and fix lint
2018-01-16 12:37:15 -08:00
uniqueiniquity
5ea43db6ec
Add test
2018-01-16 11:27:20 -08:00
Wesley Wigham
2e1738bffa
Enable substitution for object literal shorthand property assignments in the system transform ( #21106 )
2018-01-12 18:24:41 -08:00
Wesley Wigham
64305edbce
Skip outer expressions when checking for super keyword in binder ( #20164 )
...
* Skip outter expressions when checking for super keyword in binder
* use TransformFlags to optimize and correct super call transforms
* Lint
2018-01-12 18:24:02 -08:00
Nathan Shively-Sanders
d74820d519
Remove mapped types to never from intersections
...
when transforming an indexed access type in order to get its constraint.
2018-01-12 14:43:31 -08:00
Anders Hejlsberg
13bf022ef6
Add regression tests
2018-01-11 16:45:44 -08:00
Nathan Shively-Sanders
baf31ec52e
Test Diff and Omit
2018-01-11 16:30:05 -08:00
Nathan Shively-Sanders
c0dd832e46
Test:incorrect mapped type doesn't infinitely recur
2018-01-10 15:40:37 -08:00
Jack Williams
4acdca5258
Enforce strictNullChecks for RHS of empty destructuring assignment
...
When strictNullChecks is on, check the RHS of the following
destructuring assignments for possible null or undefined:
const {} = ...
const [] = ...
let {} = ...
let [] = ...
({} = ...)
2018-01-10 01:46:36 +00:00
Wesley Wigham
c9ef52b9d8
Do not always instantiate jsx signatures ( #21108 )
2018-01-09 17:22:19 -08:00
Stanislav Iliev
03fd77657d
Issue implicit any errors for mapped types without annotations ( #21104 )
...
* Fixed #21011
* Updated code of merged message
* Reversed message code change and moved error to it's appropriate position
* Applied suggested improvements
* Fixed wrong diagnostics message in checker
* Reverted diagnostic message change
2018-01-09 17:11:57 -08:00
Wesley Wigham
fdd8a52240
Offer per-member diagnostics for incorrectly implemented inherited members ( #21036 )
...
* Offer per-member diagnostics for incorrectly implemented inherited members on classes
* Revise error message, make containingChain a thunk
* Fix typo in comment
2018-01-09 10:20:07 -08:00
Andy
5ab5694a5b
Don't count self-reference in more cases (skip more nodes when setting lastNonBlockLocation) ( #21095 )
2018-01-09 09:53:39 -08:00
Remo H. Jansen
73e3e8d790
Fixes #20026 ( #20157 )
...
* Added test case for #20026
* Implemented #20026
* Addresed comments at Microsoft/TypeScript/pull/20157#discussion_r152086287
* Fixed merge issues
* Fixed baseline issue
* Merged upstream
2018-01-08 17:25:56 -08:00
Andy
37d4f6a69d
Mark references to dynamically-named properties as used ( #21010 )
...
* Mark references to dynamically-named properties as used
* Avoid showing the symbol ID
* Use symbolToString instead of showSymbol
2018-01-08 16:44:58 -08:00
Wesley Wigham
7e6315075d
Synthesize namespace records for proper esm interop ( #19675 )
...
* Integrate importStar and importDefault helpers
* Accept baselines
* Support dynamic imports, write helpers for umd module (and amd is possible) kinds
* Accept baselines
* Support AMD, use same helper initialization as is normal
* update typechecker to have errors on called imported namespaces and good error recovery with a quickfix
* Overhaul allowSyntheticDefaultExports to be safer
* Put the new behavior behind a flag
* Rename strictESM to ESMInterop
* ESMInterop -> ESModuleInterop, make default for tsc --init
* Rename ESMInterop -> ESModuleInterop in module.ts, add emit test (since fourslash doesnt do that)
* Remove erroneous semicolons from helper
* Reword diagnostic
* Change style
* Edit followup diagnostic
* Add secondary quickfix for call sites, tests forthcoming
* Add synth default to namespace import type, enhance quickfix
* Pair of spare tests for good measure
* Fix typos in diagnostic message
* Improve comment clarity
* Actually accept the updated changes to the esmodule interop description
* ESModule -> esModule
* Use find and not forEach
* Use guard
* Rely on implicit falsiness of Result.False
* These should have been emit flags
2018-01-08 16:36:23 -08:00
Wesley Wigham
b1a0261575
If declaration emit input is a module, output should be a module ( #20626 )
2018-01-08 13:58:34 -08:00
Wesley Wigham
b2f2610b85
Use getInternalName not getLocalName ( #20168 )
2018-01-08 13:55:50 -08:00
Daniel Rosenwasser
6d596c058e
Merge pull request #20726 from kujon/indexable_types
...
Improved error messaging for index signature parameters
2018-01-08 13:23:39 -08:00
Wenlu Wang
a82d1f8580
ignore Initial check if left of DestructuringAsignment ( #20906 )
2018-01-08 13:13:23 -08:00
Wesley Wigham
b5fda4970d
Use emptyObjectType for omitted members instead of unknownType ( #20940 )
...
* Use emptyObjectType for omitted members instead of unknownType
* Use similar logic as is used for empty arrays for missing elements
2018-01-08 12:27:11 -08:00
Andy
f83283c068
Improve parse error for double comma somewhere inside a call expression ( #20399 )
2018-01-08 10:38:55 -08:00
Nathan Shively-Sanders
e78ac47208
Merge pull request #20711 from Microsoft/defer-inference-for-recursive-mapped-types
...
Defer inference for homomorphic mapped types
2018-01-05 16:01:26 -08:00
Andy
c6e4373403
In checkAndAggregateReturnExpressionTypes, treat MethodDeclaration in an object literal same as a FunctionExpression ( #20052 )
...
* In checkAndAggregateReturnExpressionTypes, treat MethodDeclaration in an object literal same as a FunctionExpression
* Add original test case
2018-01-05 12:34:01 -08:00
Andy
f6dc0ad707
Check for unused getter/setter in classes ( #21013 )
...
* Check for unused getter/setter in classes
* Write-only use of setter is still a reference; and don't error on setter if getter exists
2018-01-05 09:10:58 -08:00
Nathan Shively-Sanders
81a601bb49
Test:deferred mapped types
2018-01-03 15:54:43 -08:00
Nathan Shively-Sanders
7393433593
Merge branch 'master' into defer-inference-for-recursive-mapped-types
2018-01-03 12:19:21 -08:00
Daniel Rosenwasser
0477f91dba
Merge pull request #20928 from Microsoft/initializerWithPropertyAccessUseBeforeDeclaration
...
Check whether we have a class before testing whether we have a super-class
2017-12-29 14:47:13 -08:00
Daniel Rosenwasser
0d56a0545c
Added tests.
2017-12-29 12:30:18 -08:00
Wesley Wigham
ae211983eb
Add method signature handler to getTypeOfVariableOrParameterOrProperty ( #20825 )
2017-12-28 19:00:54 -08:00
Nathan Shively-Sanders
2df7a89e61
Merge branch 'master' into limit-recursive-structured-type-resolution
2017-12-22 14:41:58 -08:00
Nathan Shively-Sanders
fb3042c3f7
Move recursion limiter to individual resolve* functions
2017-12-22 14:39:25 -08:00
Wesley Wigham
cedcba9285
Reset partial memberlist on defered circularity to calculate the correct members ( #20179 )
...
* Reset partial memberlist on defered circularity to calculate the correct members
* Remove return type
2017-12-22 11:41:39 -08:00