2415 Commits

Author SHA1 Message Date
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
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
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
Andy
8153397e91
Lazily compute signature type predicates (#17600)
* Lazily compute signature type predicates

* Use an instance of IdentifierTypePredicate to represent an unresolved type predicate

* Simplify `getMaybeTypePredicate`

* Invert representation of `resolvedTypePredicate`

* Remove `__unresolvedTypePredicate` type and remember to use `noTypePredicate` instead of `undefined` when in all `createSignature` calls

* Fix style of getTypePredicateOfSignature

* Use in createGetSymbolWalker

* Fix bugs for unions of type predicates

* Code review

* Make noTypePredicate purely an implementation detail of getTypePredictateOfSignature

* Add test

* Add test for #19642

* Add test with reversed order
2017-12-05 08:32:34 -08:00
Diogo Franco (Kovensky)
c894eebe51 Accept Iterable|ArrayLike union in Array.from, test 2017-12-05 14:37:51 +09:00
Andy
37a40561ac
Support exponentiation operator in const enums (#20424) 2017-12-04 14:32:25 -08:00
Mohamed Hegazy
59e5bbc393
Make sure autoArrayType is unique, even if no lib is available (#20344)
* Make sure autoArrayType is unique, even if no lib is available

* fix typo
2017-12-01 19:51:14 -08:00
Wesley Wigham
1045d95a44
Always instantiate the extends clause, even in the presence of an error (#20232)
* Still instantiate the extends clause even when theres a noimplicitany error in js

* Only be permissive for JS

* In JS, instantiate classes even when they have too many type arguments, instead of returning unknownType
2017-12-01 21:09:06 -05:00
Anders Hejlsberg
f6b1a1de59
Merge pull request #20404 from Microsoft/fixUntypedFunctionCall
Fix untyped function call on constrained type variable
2017-12-01 17:19:32 -08:00
Anders Hejlsberg
3531bd2b57 Add regression test 2017-12-01 16:54:32 -08:00
Nathan Shively-Sanders
8d7c2a2a77
Merge pull request #20370 from Microsoft/cutoff-inference-for-recursive-mapped-types
Cut off inference for recursive mapped types
2017-12-01 15:10:06 -08:00
Nathan Shively-Sanders
7cfe6a4cdb Test:Mutually recursive types do not recur infinitely 2017-12-01 15:00:37 -08:00
Nathan Shively-Sanders
1068ee105d Test:inference to self-referential mapped type
From a self-referential type.
2017-11-30 09:40:43 -08:00
Andrew Casey
3a05363a29 Correct errorForUsingPropertyOfTypeAsType03
Rename didn't work properly in a file with errors, so the test isn't
testing the right thing.
2017-11-29 17:48:58 -08:00
Andrew Casey
cdd3cd4f51
Merge pull request #20335 from amcasey/TS2713
Apply TS2713 to classes
2017-11-29 17:39:32 -08:00
Wesley Wigham
a1669bb431
handle multiline jsx strings correctly, emit escapes in jsx attributes correctly (#20309) 2017-11-29 17:08:51 -08:00
Wesley Wigham
a625dec58a
Elide import namespace from which only const enums are used (#20320) 2017-11-29 16:36:17 -08:00
Andrew Casey
170cb9c811 Add baselines for the current state of enum members 2017-11-29 15:57:11 -08:00
Andrew Casey
31c4ca5235 Handle all non-namespace types 2017-11-29 15:49:58 -08:00
Charles Pierce
72da4b8f12 Error when LHS of instanceof is Union of Primitives #18519 (#19063)
* Error when LHS of instanceof is Union of Primitives #18519

* Refactor to allTypesAssignableToKind method and update test

* Use ternary expression instead of if / else blocks
2017-11-28 15:05:06 -08:00
Wesley Wigham
835fae264f
Allow possibly undefined destructuring in ambient parameter declarations (#20230) 2017-11-27 23:16:21 -08:00
Anders Hejlsberg
61094ec2ea
Merge pull request #20229 from Microsoft/fixParenthesizedAsyncArrowFunction
Fix parenthesized async arrow function
2017-11-22 19:50:35 -08:00
Anders Hejlsberg
3a00b76cff Add regression test 2017-11-22 10:50:49 -08:00
Andy
013ce8e36d
Catch illegal jsdoc tags on constructors (#20045) 2017-11-21 21:36:08 -05:00
Wesley Wigham
50866e114a
Fix visibility checking of mutually recursive exports (#19929)
* Do visibility painting from collectLinkedAliases in checker to remove statefullness in declaration emit

* Fix #17085

* Add deeply destructured array to test

* Add test case for #18634

* Add PR feedback
2017-11-21 15:06:27 -08:00
Anders Hejlsberg
8c4c529d8e Merge branch 'master' into strictPropertyInitialization 2017-11-17 14:30:23 -08:00
Nathan Shively-Sanders
c698a2b8e5
Merge pull request #19227 from Microsoft/infer-object-type-from-string-literal-to-keyof-T
Infer object type from string literal to keyof T
2017-11-16 15:07:12 -08:00
Charles Pierce
1da35d9dca Treat exhaustive switch as last statement in function #18882 (#20063) 2017-11-16 12:17:26 -08:00
Anders Hejlsberg
3a7a99f7c5 Accept new baselines 2017-11-16 11:08:03 -08:00
Anders Hejlsberg
3357aae2d8 Update tests 2017-11-16 10:58:12 -08:00
Ron Buckton
a21a129abb Merge branch 'master' into dynamicNames 2017-11-15 15:24:05 -08:00