TypeScript/tests/cases/conformance/types/intersection
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
..
commonTypeIntersection.ts Add isIntersectionConstituent to relation key (#34789) 2019-10-29 15:08:59 -07:00
contextualIntersectionType.ts
intersectionAndUnionTypes.ts
intersectionAsWeakTypeSource.ts
intersectionMemberOfUnionNarrowsCorrectly.ts Add isIntersectionConstituent to relation key (#34789) 2019-10-29 15:08:59 -07:00
intersectionOfUnionOfUnitTypes.ts
intersectionReduction.ts Reduce intersections by discriminants (#36696) 2020-02-28 17:06:44 -08:00
intersectionReductionStrict.ts Reduce intersections by discriminants (#36696) 2020-02-28 17:06:44 -08:00
intersectionsAndEmptyObjects.ts
intersectionThisTypes.ts
intersectionTypeAssignment.ts
intersectionTypeEquivalence.ts
intersectionTypeInference.ts
intersectionTypeInference2.ts
intersectionTypeInference3.ts
intersectionTypeMembers.ts
intersectionTypeOverloading.ts
intersectionTypeReadonly.ts
intersectionWithIndexSignatures.ts Check combined intersection properties against target index signatures (#35143) 2020-01-10 10:46:10 -08:00
intersectionWithUnionConstraint.ts
operatorsAndIntersectionTypes.ts
recursiveIntersectionTypes.ts