You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 #33213Fixes#34762 (by reverting #33213)
Fixes#33944 -- I added the test from #34646
* Update comments in test
tests/cases/conformance/types/intersection/commonTypeIntersection.ts(2,5): error TS2322: Type '{ __typename?: "TypeTwo"; } & { a: boolean; }' is not assignable to type '{ __typename?: "TypeOne"; } & { a: boolean; }'.
2
+
Type '{ __typename?: "TypeTwo"; } & { a: boolean; }' is not assignable to type '{ __typename?: "TypeOne"; }'.
3
+
Types of property '__typename' are incompatible.
4
+
Type '"TypeTwo"' is not assignable to type '"TypeOne"'.
5
+
tests/cases/conformance/types/intersection/commonTypeIntersection.ts(4,5): error TS2322: Type '{ __typename?: "TypeTwo"; } & string' is not assignable to type '{ __typename?: "TypeOne"; } & string'.
6
+
Type '{ __typename?: "TypeTwo"; } & string' is not assignable to type '{ __typename?: "TypeOne"; }'.
7
+
Types of property '__typename' are incompatible.
8
+
Type '"TypeTwo"' is not assignable to type '"TypeOne"'.
!!! error TS2322: Type '"text" | "email"' is not assignable to type 'ChannelOfType<T, TextChannel>["type"] & ChannelOfType<T, EmailChannel>["type"]'.
64
67
!!! error TS2322: Type '"text"' is not assignable to type 'ChannelOfType<T, TextChannel>["type"] & ChannelOfType<T, EmailChannel>["type"]'.
65
68
!!! error TS2322: Type '"text"' is not assignable to type 'ChannelOfType<T, TextChannel>["type"]'.
66
-
!!! error TS2322: Type 'T' is not assignable to type 'ChannelOfType<T, TextChannel>["type"]'.
67
-
!!! error TS2322: Type '"text" | "email"' is not assignable to type 'ChannelOfType<T, TextChannel>["type"]'.
68
-
!!! error TS2322: Type '"text"' is not assignable to type 'ChannelOfType<T, TextChannel>["type"]'.
69
-
!!! error TS2322: Type '"text"' is not assignable to type 'T & "text"'.
70
-
!!! error TS2322: Type '"text"' is not assignable to type 'T'.
71
-
!!! error TS2322: '"text"' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '"text" | "email"'.
72
-
!!! error TS2322: Type 'T' is not assignable to type 'T & "text"'.
73
-
!!! error TS2322: Type '"text" | "email"' is not assignable to type 'T & "text"'.
74
-
!!! error TS2322: Type '"text"' is not assignable to type 'T & "text"'.
75
-
!!! error TS2322: Type '"text"' is not assignable to type 'T'.
76
-
!!! error TS2322: '"text"' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '"text" | "email"'.
77
-
!!! error TS2322: Type 'T' is not assignable to type '"text"'.
78
-
!!! error TS2322: Type '"text" | "email"' is not assignable to type '"text"'.
79
-
!!! error TS2322: Type '"email"' is not assignable to type '"text"'.
69
+
!!! error TS2322: Type '"text"' is not assignable to type 'T & "text"'.
70
+
!!! error TS2322: Type '"text"' is not assignable to type 'T'.
71
+
!!! error TS2322: '"text"' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '"text" | "email"'.
72
+
!!! error TS2322: Type 'T' is not assignable to type 'ChannelOfType<T, TextChannel>["type"]'.
73
+
!!! error TS2322: Type '"text" | "email"' is not assignable to type 'ChannelOfType<T, TextChannel>["type"]'.
74
+
!!! error TS2322: Type '"text"' is not assignable to type 'ChannelOfType<T, TextChannel>["type"]'.
75
+
!!! error TS2322: Type '"text"' is not assignable to type 'T & "text"'.
76
+
!!! error TS2322: Type '"text"' is not assignable to type 'T'.
77
+
!!! error TS2322: '"text"' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '"text" | "email"'.
78
+
!!! error TS2322: Type 'T' is not assignable to type 'T & "text"'.
79
+
!!! error TS2322: Type '"text" | "email"' is not assignable to type 'T & "text"'.
80
+
!!! error TS2322: Type '"text"' is not assignable to type 'T & "text"'.
81
+
!!! error TS2322: Type '"text"' is not assignable to type 'T'.
82
+
!!! error TS2322: '"text"' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '"text" | "email"'.
83
+
!!! error TS2322: Type 'T' is not assignable to type '"text"'.
84
+
!!! error TS2322: Type '"text" | "email"' is not assignable to type '"text"'.
85
+
!!! error TS2322: Type '"email"' is not assignable to type '"text"'.
0 commit comments