2443 Commits

Author SHA1 Message Date
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
Wesley Wigham
7ad0d7b9fd
Fix higher order inference on indexed access types (#20165) 2017-12-21 14:47:03 -08:00
Wesley Wigham
00450f029c
Not all extended types have symbols (#20827) 2017-12-21 13:07:29 -08:00
Anders Hejlsberg
2f4c8ebf13 Add regression test 2017-12-19 19:58:28 -08:00
kujon
c92c7a5b10 Addressed the suggestions 2017-12-19 21:29:03 +00:00
Daniel Rosenwasser
69e091b40d
Merge pull request #19797 from charlespierce/implements_class_error_message
Add new error message when class implements class
2017-12-19 11:39:05 -08:00
Wesley Wigham
ae73a9141d
Allow JSXAttributes types to be shortcut-spread into the spread type like normal objects (#19047)
* Bring jsx type resolution inline with normal objects, move jsx attribute property ignorign into relationship check

* Improved errors and reordered members

* Always use inferrential mode for jsx pass

* Add some missing skipLibChecks

* New check mode instead of odd type mapper

* Do not enable object literal freshness checks on jsx spreads

* Fix minor style nits

* Update order of type for test

* Accept corrected baseline
2017-12-15 16:13:28 -08:00
Wesley Wigham
dd933f4413
Fix get symbol at location to behave correctly for parameter assignments and jsx attributes (#20706)
* Fix get symbol at location to behave correctly got parameter assignments and jsx attributes

* Handle all those edge cases that weren;t explicitly handled

* Fix part of bug WRT getTypeAtLocation and for loops

* Baseline corrections pursuant to #20710

* Restore jsdoc tag interpretation

* Clean up some code, revert fourslash tests

* Cleanup types used by PR feedback
2017-12-15 15:50:22 -08:00
kujon
8755d4da47 Fixed an incorrect assumption K in Union works with numeric literals 2017-12-15 22:28:29 +00:00
kujon
92bffe43c5 Fixed a mistake, whereby the check for the literal type was satisfied when any (not every) was a literal 2017-12-15 22:04:24 +00:00
kujon
a0d827cfdf Improved error messages for Union index signature params 2017-12-15 21:44:37 +00:00
kujon
0c089d8d66 Better error messages for aliased index types 2017-12-15 21:25:16 +00:00
Nathan Shively-Sanders
dd941e5665 Add more tests of deferred mapped types 2017-12-14 15:11:49 -08:00
Nathan Shively-Sanders
6b024f6495 Test:XMLHttpRequest inference to PartialDeep<T>
Compilation didn't finish before! Now it does.
2017-12-14 13:35:32 -08:00
Wesley Wigham
e1278f091c
Get resolved module exports in symbol chain and not raw exports (#20661)
* Actually get module exports and not module exports sans export stars

* style update

* Trim test a bit
2017-12-13 14:01:23 -08:00
Andy
6fbeced025
Simplify test case (#20675) 2017-12-13 11:03:37 -08:00
Wesley Wigham
40029a0523
Use TypeFlags.UnionOrIntersection not TypeFlags.Union (#20662) 2017-12-12 16:32:55 -08:00
Andy
d53af092c7
Always check a return expression in a generator (#20621) 2017-12-12 07:50:11 -08:00
Charles Pierce
c489dd96f6 Resolve merge conflicts in codeFix 2017-12-11 22:27:56 -08:00
Wesley Wigham
eba15b5990
Preserve literal types in contextual unions (#19966)
* Cherrypick non-comparability related changes from prolific literals PR

* Renames and other style changes

* Accept changes to new tests

* Exclude the domain root from contextual typing literals except for type variables

* Readd simple preservation fix

* Add huge map test

* Revert changes to widening on destructuring initalizers

* Use tristate for subtype-reduction type

* Rename type and argument

* Move longer-running test to user suite
2017-12-11 18:03:38 -05:00
Wesley Wigham
d01f4d140a
Reimplement #20320 differently to handle multiple check orders better (#20588)
* Reimplement #20320 less elegantly but handle odd check orders better

* Consolidate 2 of 3 conditions
2017-12-11 13:32:16 -05:00
Andy
484758a3d3
Handle ! following a keyword in isClassMemberStart (#20617)
* Handle `!` following a keyword in isClassMemberStart

* Fix test
2017-12-11 09:45:36 -08:00
Daniel Rosenwasser
8d209a3672
Merge pull request #20467 from Kovensky/array-from-union-fix
Accept Iterable|ArrayLike union in Array.from, add tests
2017-12-07 17:22:05 -08:00
Andy
5e5b7706e5
Hack to allow concat to work even when an Array isn't assignable to ReadonlyArray (#20455) 2017-12-07 12:15:12 -08:00
Charles Pierce
472f087e69 Add new error message when class implements class #19793 2017-12-05 21:18:31 -08:00
IdeaHunter
069f73d0f2 Change type narrowing for optional properties 2017-12-06 00:02:36 +03:00
IdeaHunter
9c3c2adfb0 Add initial support for 'in' typeguarding 2017-12-06 00:02:36 +03:00