Commit graph

695 commits

Author SHA1 Message Date
Andrew Branch 1d5749ef78
Fix local and exported type alias merging (#36237)
* Fix local and exported type alias merging

* Add baselines
2020-01-22 13:16:49 -08:00
Anders Hejlsberg 357f715382
Check combined intersection properties against target index signatures (#35143)
* Check combined intersection properties against target index signatures

* Add tests

* Accept new baselines

* Less aggressive check for index signatures

* Track intersection membership state for both source and target

* Minor fixes
2020-01-10 10:46:10 -08:00
Anders Hejlsberg f8bfc6f5d6
Contextually typed binding element initializers (#35855)
* Binding element initializers contextually typed by parent initializers

* Accept new baselines

* Literal type widening should be last step in inference

* Accept new baselines

* Add tests
2020-01-06 12:53:23 -08:00
Anders Hejlsberg 2f0d07c29a
Increase selectivity of subtype relationship for signatures (#35659)
* Increase selectivity of subtype relationship for signatures

* Add regression test

* Accept new baselines

* Use strictSubtypeRelation for union subtype reduction

* (x: number | undefined) -> void is subtype of (x?: number | undefined) => void

* Accept new baselines

* Add tests

* Accept new baselines

* Address CR feedback

* Fix parameter list length check

* Accept API baseline changes
2019-12-20 14:52:22 -08:00
Anders Hejlsberg 71a91763f4
Fix33448 (#35513)
* Filter out discriminants of type 'never'.

* Add tests

* Accept new baselines

* Remove unnecessary '!' assertion
2019-12-12 06:45:46 -08:00
Wesley Wigham b9689228b5
When calculating spreads, merge empty object into nonempty object to … (#34853)
* When calculating spreads, merge empty object into nonempty object to produce partial object to reduce complexity

* Actually accept remainder of baselines

* Limit simplification to single prop or partial types
2019-11-22 17:19:17 -08:00
Anders Hejlsberg 94d4023043
Add inference priority level for conditional types in contravariant positions (#35199)
* Add inference priority level for conditional types in contravariant positions

* Accept new API baselines

* Add regression tests

* Accept new baselines
2019-11-21 13:05:44 -08:00
Anders Hejlsberg 8b83703632
Properly strip readonly from rest argument types (#35169)
* Properly strip readonlyness from rest argument types

* Add tests

* Accept new baselines
2019-11-18 13:11:36 -08:00
Nathan Shively-Sanders 00dd1f0609
Add isIntersectionConstituent to relation key (#34789)
* Add isIntersectionConstituent to relation key

isIntersectionConstituent controls whether relation checking performs
excess property and common property checks. It is possible to fail a
relation check with excess property checks turned on, cache the result,
and then skip a relation check with excess property checks that would
have succeeded. #33133 provides an example of such a program.

Fixes #33133 the right way, so I reverted the fix at #33213
Fixes #34762 (by reverting #33213)
Fixes #33944 -- I added the test from #34646

* Update comments in test
2019-10-29 15:08:59 -07:00
Anders Hejlsberg 56520da6f0 Add regression tests 2019-10-20 18:00:08 -07:00
Ron Buckton a47ac63738
Fix for incorrect 'this' type for optional call (#33799) 2019-10-04 13:39:42 -07:00
Anders Hejlsberg 46bddedb4b Add regression tests 2019-09-30 09:28:19 -07:00
Anders Hejlsberg e3d23cc40e Add tests 2019-09-24 06:55:38 -07:00
Jack Williams 1c20aa0b1a Narrow unknown under inequality when assumed false (#33488) 2019-09-18 10:54:42 -07:00
Ron Buckton 344dba8809
Fix incorrect parameter types for AsyncIterator next/return (#33354) 2019-09-17 21:02:12 -07:00
Collins Abitekaniza 0341c2fe75 add baseline for unknown type spread 2019-08-19 16:32:09 +03:00
Anders Hejlsberg 489abcacd4
Merge pull request #32919 from microsoft/fix32752
Stricter criteria for eliminating types in unions during inference
2019-08-16 10:55:48 -07:00
Anders Hejlsberg c816cf2562 Add additional test 2019-08-16 07:45:02 -07:00
Orta 6cd8bcd6c9
Merge pull request #31185 from collin5/b30851
Restrict spreading for Instantiable Type with non object constraint
2019-08-15 13:50:01 -07:00
Anders Hejlsberg f929a25407 Add regression test 2019-08-15 10:02:32 -07:00
Anders Hejlsberg 4cc6618fc2
Merge pull request #32558 from microsoft/fix32247
Infer between closely matching types in unions and intersections
2019-07-29 11:34:14 -07:00
Andrew Branch 3d09010dc8
Intersect 'this' types in union signatures (#32538)
* Intersect this types in union signatures

* Actually update baselines
2019-07-26 14:56:03 -07:00
Anders Hejlsberg ec38799e2a Add more tests 2019-07-26 13:17:00 -07:00
Anders Hejlsberg b9d27c0f2c Add regression tests 2019-07-25 11:52:08 -07:00
Anders Hejlsberg d96d16e10b Add additional test 2019-07-20 10:01:59 -07:00
Anders Hejlsberg ae1add7210 Update tests 2019-07-17 15:02:20 -07:00
Anders Hejlsberg 7d4259ba9f Update tests 2019-07-17 14:57:26 -07:00
Andrew Branch 8516127a05
Fix regression of generic T assignability to Partial<T> (#32354) 2019-07-12 07:57:55 -07:00
Anders Hejlsberg de2fb9584e Add regression test 2019-07-04 16:27:03 -10:00
Andrew Branch 327bc3cb67
Merge pull request #32071 from andrewbranch/bug/31070
Allow assignability of non-empty object to generic mapped type
2019-07-01 13:18:44 -07:00
Andrew Branch 7bbd299226
Look at properties of constraint-instantiated optional mapped types when deciding assignability 2019-06-24 15:19:43 -07:00
Anders Hejlsberg 076d9ad2ab Add regression test 2019-06-23 09:19:56 -10:00
Anders Hejlsberg 98bbb22bc4 Add tests 2019-06-09 10:18:36 -07:00
Anders Hejlsberg 9cc9fb9bd7 Update tests 2019-06-09 08:00:01 -07:00
Anders Hejlsberg 59dc85797e Add regression test 2019-05-31 11:04:02 -07:00
Wesley Wigham e70f2af25d
Defer union or intersection property type normalization (#31486)
* Defer union or intersection property type normalization

* Accept moved span
2019-05-28 10:51:47 -07:00
Andrew Branch a06ab8532c
Merge pull request #31560 from andrewbranch/bug/31485
Fix crash when creating a union signature from signatures that do and don’t have `this` types
2019-05-24 10:30:47 -07:00
Andrew Branch a2b40292fe
Merge pull request #31542 from andrewbranch/bug/31481
Error when writing to rest element range of readonly tuple
2019-05-23 13:38:09 -07:00
Anders Hejlsberg e6013335b9
Merge pull request #31537 from microsoft/fixIndexedAccessConstraint
Fix indexed access constraint
2019-05-22 18:35:15 -07:00
Andrew Branch 300cbef071
Don’t crash when creating a union signature from signatures that do and don’t have this types 2019-05-22 17:42:05 -07:00
Andrew Branch 9f6791a5ab
Error when writing to readonly tuple in rest element range 2019-05-22 15:03:17 -07:00
Andrew Branch eecb6d9049
Add failing test 2019-05-22 13:39:05 -07:00
Ron Buckton 6a559e37ee
Fix crash when checking invalid object rest (#31530) 2019-05-22 11:20:57 -07:00
Ron Buckton c3055e585d
Fix compiler crash with object rest in catch binding (#31522) 2019-05-22 11:20:07 -07:00
Anders Hejlsberg 2fd4aaee92 Add regression test 2019-05-22 06:54:16 -07:00
Anders Hejlsberg c6a670d26c Add regression test 2019-05-17 15:59:01 -07:00
Anders Hejlsberg ee59cee381 Add regression test 2019-05-10 09:56:17 -07:00
Collins Abitekaniza 2bb2f9ff68 add baseline tests for spreading instantiable type 2019-05-03 05:31:28 +03:00
Anders Hejlsberg be409fad84
Merge pull request #31137 from Microsoft/fixConditionalInference
Fix conditional type inference involving any or unknown
2019-04-30 06:26:02 -07:00
Anders Hejlsberg a539887893
Merge pull request #31150 from Microsoft/fixReadonlyIndexedAccess
Fix readonly indexed access used in indexed access type
2019-04-29 16:59:13 -07:00