TypeScript/tests/cases/conformance/types/union
Anders Hejlsberg be4b814a4c
Reduce intersections by discriminants (#36696)
* Treat never-like intersections as never

* Accept new baselines

* Fix compiler issues revealed by increased intersection correctness

* Delete fourslash tests that are no longer applicable

* Include isNeverLikeIntersection check in getNormalizedType

* Erase never-like types in several more places

* Check that base types are not never-like

* Add comments

* Revert isNeverLikeType check in getIndexType (keyof shouldn't resolve member types)

* Introduce getReducedType for union and intersection types

* Don't reduce in getApparentType

* Avoid relationship check in resolveMappedTypeMembers

* Accept new baselines

* Don't call getReducedType in getIndexType

* Ensure reduced and unreduced forms of a type can compare identical

* Reduce types before converting them to string representation

* Accept new baselines

* Reduce intersections before obtaining keyof X

* Add tests

* Accept new baselines

* Fix comment in tests

* Don't infer from empty intersection types

* Add tests

* Accept new baselines

* Defer instantiation of mapped type property types

* Accept new baselines

* Include more precise type in diagnostic

* Accept new baselines

* Minor optimization

* Improve error message

* Optional properties in intersections are never discriminants
2020-02-28 17:06:44 -08:00
..
contextualTypeWithUnionTypeCallSignatures.ts
contextualTypeWithUnionTypeIndexSignatures.ts Use string/number signature to get contextual type 2018-10-11 15:12:13 -07:00
contextualTypeWithUnionTypeMembers.ts
contextualTypeWithUnionTypeObjectLiteral.ts
discriminatedUnionTypes1.ts [Transforms] Merging Master to Transforms on 06/21 (#9294) 2016-07-11 12:41:12 -07:00
discriminatedUnionTypes2.ts Reduce intersections by discriminants (#36696) 2020-02-28 17:06:44 -08:00
unionTypeCallSignatures.ts Allow union signatures to merge when they have differing argument counts (#28604) 2018-11-19 17:05:28 -08:00
unionTypeCallSignatures2.ts Addressing CR feedback 2015-08-06 17:17:20 -07:00
unionTypeCallSignatures3.ts Adding new test 2015-08-07 08:06:10 -07:00
unionTypeCallSignatures4.ts Allow union signatures to merge when they have differing argument counts (#28604) 2018-11-19 17:05:28 -08:00
unionTypeCallSignatures5.ts 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
unionTypeCallSignatures6.ts Intersect 'this' types in union signatures (#32538) 2019-07-26 14:56:03 -07:00
unionTypeConstructSignatures.ts Allow union signatures to merge when they have differing argument counts (#28604) 2018-11-19 17:05:28 -08:00
unionTypeEquivalence.ts
unionTypeFromArrayLiteral.ts Array literal produces union type if the it is not contextually typed 2014-11-04 15:58:44 -08:00
unionTypeIndexSignature.ts
unionTypeMembers.ts
unionTypePropertyAccessibility.ts Adding test 2015-04-16 14:41:33 -07:00
unionTypeReadonly.ts [Transforms] Merge master 07/11 into transform (#9697) 2016-07-18 15:38:30 -07:00
unionTypeReduction.ts Adding test 2015-04-12 10:52:20 -07:00
unionTypeReduction2.ts Increase selectivity of subtype relationship for signatures (#35659) 2019-12-20 14:52:22 -08:00
unionTypeWithIndexSignature.ts Index signatures contribute properties to unions (#25307) 2018-07-06 10:46:05 -07:00