|
|
|
@@ -116,260 +116,263 @@ declare let ab: A & B;
|
|
|
|
|
ab.kind; // Error
|
|
|
|
|
>ab : Symbol(ab, Decl(intersectionReduction.ts, 36, 11))
|
|
|
|
|
|
|
|
|
|
ab = 42;
|
|
|
|
|
>ab : Symbol(ab, Decl(intersectionReduction.ts, 36, 11))
|
|
|
|
|
|
|
|
|
|
declare let x: A | (B & C); // A
|
|
|
|
|
>x : Symbol(x, Decl(intersectionReduction.ts, 39, 11))
|
|
|
|
|
>x : Symbol(x, Decl(intersectionReduction.ts, 40, 11))
|
|
|
|
|
>A : Symbol(A, Decl(intersectionReduction.ts, 30, 28))
|
|
|
|
|
>B : Symbol(B, Decl(intersectionReduction.ts, 32, 36))
|
|
|
|
|
>C : Symbol(C, Decl(intersectionReduction.ts, 33, 36))
|
|
|
|
|
|
|
|
|
|
let a: A = x;
|
|
|
|
|
>a : Symbol(a, Decl(intersectionReduction.ts, 40, 3))
|
|
|
|
|
>a : Symbol(a, Decl(intersectionReduction.ts, 41, 3))
|
|
|
|
|
>A : Symbol(A, Decl(intersectionReduction.ts, 30, 28))
|
|
|
|
|
>x : Symbol(x, Decl(intersectionReduction.ts, 39, 11))
|
|
|
|
|
>x : Symbol(x, Decl(intersectionReduction.ts, 40, 11))
|
|
|
|
|
|
|
|
|
|
type AB = A & B; // never
|
|
|
|
|
>AB : Symbol(AB, Decl(intersectionReduction.ts, 40, 13))
|
|
|
|
|
>AB : Symbol(AB, Decl(intersectionReduction.ts, 41, 13))
|
|
|
|
|
>A : Symbol(A, Decl(intersectionReduction.ts, 30, 28))
|
|
|
|
|
>B : Symbol(B, Decl(intersectionReduction.ts, 32, 36))
|
|
|
|
|
|
|
|
|
|
type BC = B & C; // never
|
|
|
|
|
>BC : Symbol(BC, Decl(intersectionReduction.ts, 42, 16))
|
|
|
|
|
>BC : Symbol(BC, Decl(intersectionReduction.ts, 43, 16))
|
|
|
|
|
>B : Symbol(B, Decl(intersectionReduction.ts, 32, 36))
|
|
|
|
|
>C : Symbol(C, Decl(intersectionReduction.ts, 33, 36))
|
|
|
|
|
|
|
|
|
|
type U1 = Partial<A & B>; // never
|
|
|
|
|
>U1 : Symbol(U1, Decl(intersectionReduction.ts, 43, 16))
|
|
|
|
|
>U1 : Symbol(U1, Decl(intersectionReduction.ts, 44, 16))
|
|
|
|
|
>Partial : Symbol(Partial, Decl(lib.es5.d.ts, --, --))
|
|
|
|
|
>A : Symbol(A, Decl(intersectionReduction.ts, 30, 28))
|
|
|
|
|
>B : Symbol(B, Decl(intersectionReduction.ts, 32, 36))
|
|
|
|
|
|
|
|
|
|
type U2 = Readonly<A & B>; // never
|
|
|
|
|
>U2 : Symbol(U2, Decl(intersectionReduction.ts, 45, 25))
|
|
|
|
|
>U2 : Symbol(U2, Decl(intersectionReduction.ts, 46, 25))
|
|
|
|
|
>Readonly : Symbol(Readonly, Decl(lib.es5.d.ts, --, --))
|
|
|
|
|
>A : Symbol(A, Decl(intersectionReduction.ts, 30, 28))
|
|
|
|
|
>B : Symbol(B, Decl(intersectionReduction.ts, 32, 36))
|
|
|
|
|
|
|
|
|
|
type U3 = (A & B)['kind']; // never
|
|
|
|
|
>U3 : Symbol(U3, Decl(intersectionReduction.ts, 46, 26))
|
|
|
|
|
>U3 : Symbol(U3, Decl(intersectionReduction.ts, 47, 26))
|
|
|
|
|
>A : Symbol(A, Decl(intersectionReduction.ts, 30, 28))
|
|
|
|
|
>B : Symbol(B, Decl(intersectionReduction.ts, 32, 36))
|
|
|
|
|
|
|
|
|
|
type U4 = A & B | B & C; // never
|
|
|
|
|
>U4 : Symbol(U4, Decl(intersectionReduction.ts, 47, 26))
|
|
|
|
|
>U4 : Symbol(U4, Decl(intersectionReduction.ts, 48, 26))
|
|
|
|
|
>A : Symbol(A, Decl(intersectionReduction.ts, 30, 28))
|
|
|
|
|
>B : Symbol(B, Decl(intersectionReduction.ts, 32, 36))
|
|
|
|
|
>B : Symbol(B, Decl(intersectionReduction.ts, 32, 36))
|
|
|
|
|
>C : Symbol(C, Decl(intersectionReduction.ts, 33, 36))
|
|
|
|
|
|
|
|
|
|
type U5 = A | B & C; // A
|
|
|
|
|
>U5 : Symbol(U5, Decl(intersectionReduction.ts, 48, 24))
|
|
|
|
|
>U5 : Symbol(U5, Decl(intersectionReduction.ts, 49, 24))
|
|
|
|
|
>A : Symbol(A, Decl(intersectionReduction.ts, 30, 28))
|
|
|
|
|
>B : Symbol(B, Decl(intersectionReduction.ts, 32, 36))
|
|
|
|
|
>C : Symbol(C, Decl(intersectionReduction.ts, 33, 36))
|
|
|
|
|
|
|
|
|
|
type K1 = keyof (A & B); // string | number | symbol
|
|
|
|
|
>K1 : Symbol(K1, Decl(intersectionReduction.ts, 49, 20))
|
|
|
|
|
>K1 : Symbol(K1, Decl(intersectionReduction.ts, 50, 20))
|
|
|
|
|
>A : Symbol(A, Decl(intersectionReduction.ts, 30, 28))
|
|
|
|
|
>B : Symbol(B, Decl(intersectionReduction.ts, 32, 36))
|
|
|
|
|
|
|
|
|
|
type K2 = keyof A | keyof B; // 'kind' | 'foo'
|
|
|
|
|
>K2 : Symbol(K2, Decl(intersectionReduction.ts, 51, 24))
|
|
|
|
|
>K2 : Symbol(K2, Decl(intersectionReduction.ts, 52, 24))
|
|
|
|
|
>A : Symbol(A, Decl(intersectionReduction.ts, 30, 28))
|
|
|
|
|
>B : Symbol(B, Decl(intersectionReduction.ts, 32, 36))
|
|
|
|
|
|
|
|
|
|
type Merge1<T, U> = { [P in keyof (T & U)]: P extends keyof T ? T[P] : U[P & keyof U] }
|
|
|
|
|
>Merge1 : Symbol(Merge1, Decl(intersectionReduction.ts, 52, 28))
|
|
|
|
|
>T : Symbol(T, Decl(intersectionReduction.ts, 54, 12))
|
|
|
|
|
>U : Symbol(U, Decl(intersectionReduction.ts, 54, 14))
|
|
|
|
|
>P : Symbol(P, Decl(intersectionReduction.ts, 54, 23))
|
|
|
|
|
>T : Symbol(T, Decl(intersectionReduction.ts, 54, 12))
|
|
|
|
|
>U : Symbol(U, Decl(intersectionReduction.ts, 54, 14))
|
|
|
|
|
>P : Symbol(P, Decl(intersectionReduction.ts, 54, 23))
|
|
|
|
|
>T : Symbol(T, Decl(intersectionReduction.ts, 54, 12))
|
|
|
|
|
>T : Symbol(T, Decl(intersectionReduction.ts, 54, 12))
|
|
|
|
|
>P : Symbol(P, Decl(intersectionReduction.ts, 54, 23))
|
|
|
|
|
>U : Symbol(U, Decl(intersectionReduction.ts, 54, 14))
|
|
|
|
|
>P : Symbol(P, Decl(intersectionReduction.ts, 54, 23))
|
|
|
|
|
>U : Symbol(U, Decl(intersectionReduction.ts, 54, 14))
|
|
|
|
|
>Merge1 : Symbol(Merge1, Decl(intersectionReduction.ts, 53, 28))
|
|
|
|
|
>T : Symbol(T, Decl(intersectionReduction.ts, 55, 12))
|
|
|
|
|
>U : Symbol(U, Decl(intersectionReduction.ts, 55, 14))
|
|
|
|
|
>P : Symbol(P, Decl(intersectionReduction.ts, 55, 23))
|
|
|
|
|
>T : Symbol(T, Decl(intersectionReduction.ts, 55, 12))
|
|
|
|
|
>U : Symbol(U, Decl(intersectionReduction.ts, 55, 14))
|
|
|
|
|
>P : Symbol(P, Decl(intersectionReduction.ts, 55, 23))
|
|
|
|
|
>T : Symbol(T, Decl(intersectionReduction.ts, 55, 12))
|
|
|
|
|
>T : Symbol(T, Decl(intersectionReduction.ts, 55, 12))
|
|
|
|
|
>P : Symbol(P, Decl(intersectionReduction.ts, 55, 23))
|
|
|
|
|
>U : Symbol(U, Decl(intersectionReduction.ts, 55, 14))
|
|
|
|
|
>P : Symbol(P, Decl(intersectionReduction.ts, 55, 23))
|
|
|
|
|
>U : Symbol(U, Decl(intersectionReduction.ts, 55, 14))
|
|
|
|
|
|
|
|
|
|
type Merge2<T, U> = { [P in keyof T | keyof U]: P extends keyof T ? T[P] : U[P & keyof U] }
|
|
|
|
|
>Merge2 : Symbol(Merge2, Decl(intersectionReduction.ts, 54, 87))
|
|
|
|
|
>T : Symbol(T, Decl(intersectionReduction.ts, 55, 12))
|
|
|
|
|
>U : Symbol(U, Decl(intersectionReduction.ts, 55, 14))
|
|
|
|
|
>P : Symbol(P, Decl(intersectionReduction.ts, 55, 23))
|
|
|
|
|
>T : Symbol(T, Decl(intersectionReduction.ts, 55, 12))
|
|
|
|
|
>U : Symbol(U, Decl(intersectionReduction.ts, 55, 14))
|
|
|
|
|
>P : Symbol(P, Decl(intersectionReduction.ts, 55, 23))
|
|
|
|
|
>T : Symbol(T, Decl(intersectionReduction.ts, 55, 12))
|
|
|
|
|
>T : Symbol(T, Decl(intersectionReduction.ts, 55, 12))
|
|
|
|
|
>P : Symbol(P, Decl(intersectionReduction.ts, 55, 23))
|
|
|
|
|
>U : Symbol(U, Decl(intersectionReduction.ts, 55, 14))
|
|
|
|
|
>P : Symbol(P, Decl(intersectionReduction.ts, 55, 23))
|
|
|
|
|
>U : Symbol(U, Decl(intersectionReduction.ts, 55, 14))
|
|
|
|
|
>Merge2 : Symbol(Merge2, Decl(intersectionReduction.ts, 55, 87))
|
|
|
|
|
>T : Symbol(T, Decl(intersectionReduction.ts, 56, 12))
|
|
|
|
|
>U : Symbol(U, Decl(intersectionReduction.ts, 56, 14))
|
|
|
|
|
>P : Symbol(P, Decl(intersectionReduction.ts, 56, 23))
|
|
|
|
|
>T : Symbol(T, Decl(intersectionReduction.ts, 56, 12))
|
|
|
|
|
>U : Symbol(U, Decl(intersectionReduction.ts, 56, 14))
|
|
|
|
|
>P : Symbol(P, Decl(intersectionReduction.ts, 56, 23))
|
|
|
|
|
>T : Symbol(T, Decl(intersectionReduction.ts, 56, 12))
|
|
|
|
|
>T : Symbol(T, Decl(intersectionReduction.ts, 56, 12))
|
|
|
|
|
>P : Symbol(P, Decl(intersectionReduction.ts, 56, 23))
|
|
|
|
|
>U : Symbol(U, Decl(intersectionReduction.ts, 56, 14))
|
|
|
|
|
>P : Symbol(P, Decl(intersectionReduction.ts, 56, 23))
|
|
|
|
|
>U : Symbol(U, Decl(intersectionReduction.ts, 56, 14))
|
|
|
|
|
|
|
|
|
|
type M1 = { a: 1, b: 2 } & { a: 2, c: 3 }; // never
|
|
|
|
|
>M1 : Symbol(M1, Decl(intersectionReduction.ts, 55, 91))
|
|
|
|
|
>a : Symbol(a, Decl(intersectionReduction.ts, 57, 11))
|
|
|
|
|
>b : Symbol(b, Decl(intersectionReduction.ts, 57, 17))
|
|
|
|
|
>a : Symbol(a, Decl(intersectionReduction.ts, 57, 28))
|
|
|
|
|
>c : Symbol(c, Decl(intersectionReduction.ts, 57, 34))
|
|
|
|
|
>M1 : Symbol(M1, Decl(intersectionReduction.ts, 56, 91))
|
|
|
|
|
>a : Symbol(a, Decl(intersectionReduction.ts, 58, 11))
|
|
|
|
|
>b : Symbol(b, Decl(intersectionReduction.ts, 58, 17))
|
|
|
|
|
>a : Symbol(a, Decl(intersectionReduction.ts, 58, 28))
|
|
|
|
|
>c : Symbol(c, Decl(intersectionReduction.ts, 58, 34))
|
|
|
|
|
|
|
|
|
|
type M2 = Merge1<{ a: 1, b: 2 }, { a: 2, c: 3 }>; // {}
|
|
|
|
|
>M2 : Symbol(M2, Decl(intersectionReduction.ts, 57, 42))
|
|
|
|
|
>Merge1 : Symbol(Merge1, Decl(intersectionReduction.ts, 52, 28))
|
|
|
|
|
>a : Symbol(a, Decl(intersectionReduction.ts, 58, 18))
|
|
|
|
|
>b : Symbol(b, Decl(intersectionReduction.ts, 58, 24))
|
|
|
|
|
>a : Symbol(a, Decl(intersectionReduction.ts, 58, 34))
|
|
|
|
|
>c : Symbol(c, Decl(intersectionReduction.ts, 58, 40))
|
|
|
|
|
|
|
|
|
|
type M3 = Merge2<{ a: 1, b: 2 }, { a: 2, c: 3 }>; // { a: 1, b: 2, c: 3 }
|
|
|
|
|
>M3 : Symbol(M3, Decl(intersectionReduction.ts, 58, 49))
|
|
|
|
|
>Merge2 : Symbol(Merge2, Decl(intersectionReduction.ts, 54, 87))
|
|
|
|
|
>M2 : Symbol(M2, Decl(intersectionReduction.ts, 58, 42))
|
|
|
|
|
>Merge1 : Symbol(Merge1, Decl(intersectionReduction.ts, 53, 28))
|
|
|
|
|
>a : Symbol(a, Decl(intersectionReduction.ts, 59, 18))
|
|
|
|
|
>b : Symbol(b, Decl(intersectionReduction.ts, 59, 24))
|
|
|
|
|
>a : Symbol(a, Decl(intersectionReduction.ts, 59, 34))
|
|
|
|
|
>c : Symbol(c, Decl(intersectionReduction.ts, 59, 40))
|
|
|
|
|
|
|
|
|
|
type D = { kind: 'd', foo: unknown };
|
|
|
|
|
>D : Symbol(D, Decl(intersectionReduction.ts, 59, 49))
|
|
|
|
|
>kind : Symbol(kind, Decl(intersectionReduction.ts, 61, 10))
|
|
|
|
|
>foo : Symbol(foo, Decl(intersectionReduction.ts, 61, 21))
|
|
|
|
|
type M3 = Merge2<{ a: 1, b: 2 }, { a: 2, c: 3 }>; // { a: 1, b: 2, c: 3 }
|
|
|
|
|
>M3 : Symbol(M3, Decl(intersectionReduction.ts, 59, 49))
|
|
|
|
|
>Merge2 : Symbol(Merge2, Decl(intersectionReduction.ts, 55, 87))
|
|
|
|
|
>a : Symbol(a, Decl(intersectionReduction.ts, 60, 18))
|
|
|
|
|
>b : Symbol(b, Decl(intersectionReduction.ts, 60, 24))
|
|
|
|
|
>a : Symbol(a, Decl(intersectionReduction.ts, 60, 34))
|
|
|
|
|
>c : Symbol(c, Decl(intersectionReduction.ts, 60, 40))
|
|
|
|
|
|
|
|
|
|
type E = { kind: 'e', foo: unknown };
|
|
|
|
|
>E : Symbol(E, Decl(intersectionReduction.ts, 61, 37))
|
|
|
|
|
type D = { kind: 'd', foo: unknown };
|
|
|
|
|
>D : Symbol(D, Decl(intersectionReduction.ts, 60, 49))
|
|
|
|
|
>kind : Symbol(kind, Decl(intersectionReduction.ts, 62, 10))
|
|
|
|
|
>foo : Symbol(foo, Decl(intersectionReduction.ts, 62, 21))
|
|
|
|
|
|
|
|
|
|
type E = { kind: 'e', foo: unknown };
|
|
|
|
|
>E : Symbol(E, Decl(intersectionReduction.ts, 62, 37))
|
|
|
|
|
>kind : Symbol(kind, Decl(intersectionReduction.ts, 63, 10))
|
|
|
|
|
>foo : Symbol(foo, Decl(intersectionReduction.ts, 63, 21))
|
|
|
|
|
|
|
|
|
|
declare function f10<T>(x: { foo: T }): T;
|
|
|
|
|
>f10 : Symbol(f10, Decl(intersectionReduction.ts, 62, 37))
|
|
|
|
|
>T : Symbol(T, Decl(intersectionReduction.ts, 64, 21))
|
|
|
|
|
>x : Symbol(x, Decl(intersectionReduction.ts, 64, 24))
|
|
|
|
|
>foo : Symbol(foo, Decl(intersectionReduction.ts, 64, 28))
|
|
|
|
|
>T : Symbol(T, Decl(intersectionReduction.ts, 64, 21))
|
|
|
|
|
>T : Symbol(T, Decl(intersectionReduction.ts, 64, 21))
|
|
|
|
|
>f10 : Symbol(f10, Decl(intersectionReduction.ts, 63, 37))
|
|
|
|
|
>T : Symbol(T, Decl(intersectionReduction.ts, 65, 21))
|
|
|
|
|
>x : Symbol(x, Decl(intersectionReduction.ts, 65, 24))
|
|
|
|
|
>foo : Symbol(foo, Decl(intersectionReduction.ts, 65, 28))
|
|
|
|
|
>T : Symbol(T, Decl(intersectionReduction.ts, 65, 21))
|
|
|
|
|
>T : Symbol(T, Decl(intersectionReduction.ts, 65, 21))
|
|
|
|
|
|
|
|
|
|
declare let a1: A | D;
|
|
|
|
|
>a1 : Symbol(a1, Decl(intersectionReduction.ts, 66, 11))
|
|
|
|
|
>a1 : Symbol(a1, Decl(intersectionReduction.ts, 67, 11))
|
|
|
|
|
>A : Symbol(A, Decl(intersectionReduction.ts, 30, 28))
|
|
|
|
|
>D : Symbol(D, Decl(intersectionReduction.ts, 59, 49))
|
|
|
|
|
>D : Symbol(D, Decl(intersectionReduction.ts, 60, 49))
|
|
|
|
|
|
|
|
|
|
declare let a2: A | D & E;
|
|
|
|
|
>a2 : Symbol(a2, Decl(intersectionReduction.ts, 67, 11))
|
|
|
|
|
>a2 : Symbol(a2, Decl(intersectionReduction.ts, 68, 11))
|
|
|
|
|
>A : Symbol(A, Decl(intersectionReduction.ts, 30, 28))
|
|
|
|
|
>D : Symbol(D, Decl(intersectionReduction.ts, 59, 49))
|
|
|
|
|
>E : Symbol(E, Decl(intersectionReduction.ts, 61, 37))
|
|
|
|
|
>D : Symbol(D, Decl(intersectionReduction.ts, 60, 49))
|
|
|
|
|
>E : Symbol(E, Decl(intersectionReduction.ts, 62, 37))
|
|
|
|
|
|
|
|
|
|
let r1 = f10(a1); // unknown
|
|
|
|
|
>r1 : Symbol(r1, Decl(intersectionReduction.ts, 69, 3))
|
|
|
|
|
>f10 : Symbol(f10, Decl(intersectionReduction.ts, 62, 37))
|
|
|
|
|
>a1 : Symbol(a1, Decl(intersectionReduction.ts, 66, 11))
|
|
|
|
|
>r1 : Symbol(r1, Decl(intersectionReduction.ts, 70, 3))
|
|
|
|
|
>f10 : Symbol(f10, Decl(intersectionReduction.ts, 63, 37))
|
|
|
|
|
>a1 : Symbol(a1, Decl(intersectionReduction.ts, 67, 11))
|
|
|
|
|
|
|
|
|
|
let r2 = f10(a2); // string
|
|
|
|
|
>r2 : Symbol(r2, Decl(intersectionReduction.ts, 70, 3))
|
|
|
|
|
>f10 : Symbol(f10, Decl(intersectionReduction.ts, 62, 37))
|
|
|
|
|
>a2 : Symbol(a2, Decl(intersectionReduction.ts, 67, 11))
|
|
|
|
|
>r2 : Symbol(r2, Decl(intersectionReduction.ts, 71, 3))
|
|
|
|
|
>f10 : Symbol(f10, Decl(intersectionReduction.ts, 63, 37))
|
|
|
|
|
>a2 : Symbol(a2, Decl(intersectionReduction.ts, 68, 11))
|
|
|
|
|
|
|
|
|
|
// Repro from #31663
|
|
|
|
|
|
|
|
|
|
const x1 = { a: 'foo', b: 42 };
|
|
|
|
|
>x1 : Symbol(x1, Decl(intersectionReduction.ts, 74, 5))
|
|
|
|
|
>a : Symbol(a, Decl(intersectionReduction.ts, 74, 12))
|
|
|
|
|
>b : Symbol(b, Decl(intersectionReduction.ts, 74, 22))
|
|
|
|
|
|
|
|
|
|
const x2 = { a: 'foo', b: true };
|
|
|
|
|
>x2 : Symbol(x2, Decl(intersectionReduction.ts, 75, 5))
|
|
|
|
|
>x1 : Symbol(x1, Decl(intersectionReduction.ts, 75, 5))
|
|
|
|
|
>a : Symbol(a, Decl(intersectionReduction.ts, 75, 12))
|
|
|
|
|
>b : Symbol(b, Decl(intersectionReduction.ts, 75, 22))
|
|
|
|
|
|
|
|
|
|
const x2 = { a: 'foo', b: true };
|
|
|
|
|
>x2 : Symbol(x2, Decl(intersectionReduction.ts, 76, 5))
|
|
|
|
|
>a : Symbol(a, Decl(intersectionReduction.ts, 76, 12))
|
|
|
|
|
>b : Symbol(b, Decl(intersectionReduction.ts, 76, 22))
|
|
|
|
|
|
|
|
|
|
declare let k: 'a' | 'b';
|
|
|
|
|
>k : Symbol(k, Decl(intersectionReduction.ts, 77, 11))
|
|
|
|
|
>k : Symbol(k, Decl(intersectionReduction.ts, 78, 11))
|
|
|
|
|
|
|
|
|
|
x1[k] = 'bar' as any; // Error
|
|
|
|
|
>x1 : Symbol(x1, Decl(intersectionReduction.ts, 74, 5))
|
|
|
|
|
>k : Symbol(k, Decl(intersectionReduction.ts, 77, 11))
|
|
|
|
|
>x1 : Symbol(x1, Decl(intersectionReduction.ts, 75, 5))
|
|
|
|
|
>k : Symbol(k, Decl(intersectionReduction.ts, 78, 11))
|
|
|
|
|
|
|
|
|
|
x2[k] = 'bar' as any; // Error
|
|
|
|
|
>x2 : Symbol(x2, Decl(intersectionReduction.ts, 75, 5))
|
|
|
|
|
>k : Symbol(k, Decl(intersectionReduction.ts, 77, 11))
|
|
|
|
|
>x2 : Symbol(x2, Decl(intersectionReduction.ts, 76, 5))
|
|
|
|
|
>k : Symbol(k, Decl(intersectionReduction.ts, 78, 11))
|
|
|
|
|
|
|
|
|
|
const enum Tag1 {}
|
|
|
|
|
>Tag1 : Symbol(Tag1, Decl(intersectionReduction.ts, 80, 21))
|
|
|
|
|
>Tag1 : Symbol(Tag1, Decl(intersectionReduction.ts, 81, 21))
|
|
|
|
|
|
|
|
|
|
const enum Tag2 {}
|
|
|
|
|
>Tag2 : Symbol(Tag2, Decl(intersectionReduction.ts, 82, 18))
|
|
|
|
|
>Tag2 : Symbol(Tag2, Decl(intersectionReduction.ts, 83, 18))
|
|
|
|
|
|
|
|
|
|
declare let s1: string & Tag1;
|
|
|
|
|
>s1 : Symbol(s1, Decl(intersectionReduction.ts, 85, 11))
|
|
|
|
|
>Tag1 : Symbol(Tag1, Decl(intersectionReduction.ts, 80, 21))
|
|
|
|
|
>s1 : Symbol(s1, Decl(intersectionReduction.ts, 86, 11))
|
|
|
|
|
>Tag1 : Symbol(Tag1, Decl(intersectionReduction.ts, 81, 21))
|
|
|
|
|
|
|
|
|
|
declare let s2: string & Tag2;
|
|
|
|
|
>s2 : Symbol(s2, Decl(intersectionReduction.ts, 86, 11))
|
|
|
|
|
>Tag2 : Symbol(Tag2, Decl(intersectionReduction.ts, 82, 18))
|
|
|
|
|
>s2 : Symbol(s2, Decl(intersectionReduction.ts, 87, 11))
|
|
|
|
|
>Tag2 : Symbol(Tag2, Decl(intersectionReduction.ts, 83, 18))
|
|
|
|
|
|
|
|
|
|
declare let t1: string & Tag1 | undefined;
|
|
|
|
|
>t1 : Symbol(t1, Decl(intersectionReduction.ts, 88, 11))
|
|
|
|
|
>Tag1 : Symbol(Tag1, Decl(intersectionReduction.ts, 80, 21))
|
|
|
|
|
>t1 : Symbol(t1, Decl(intersectionReduction.ts, 89, 11))
|
|
|
|
|
>Tag1 : Symbol(Tag1, Decl(intersectionReduction.ts, 81, 21))
|
|
|
|
|
|
|
|
|
|
declare let t2: string & Tag2 | undefined;
|
|
|
|
|
>t2 : Symbol(t2, Decl(intersectionReduction.ts, 89, 11))
|
|
|
|
|
>Tag2 : Symbol(Tag2, Decl(intersectionReduction.ts, 82, 18))
|
|
|
|
|
>t2 : Symbol(t2, Decl(intersectionReduction.ts, 90, 11))
|
|
|
|
|
>Tag2 : Symbol(Tag2, Decl(intersectionReduction.ts, 83, 18))
|
|
|
|
|
|
|
|
|
|
s1 = s2;
|
|
|
|
|
>s1 : Symbol(s1, Decl(intersectionReduction.ts, 85, 11))
|
|
|
|
|
>s2 : Symbol(s2, Decl(intersectionReduction.ts, 86, 11))
|
|
|
|
|
>s1 : Symbol(s1, Decl(intersectionReduction.ts, 86, 11))
|
|
|
|
|
>s2 : Symbol(s2, Decl(intersectionReduction.ts, 87, 11))
|
|
|
|
|
|
|
|
|
|
s2 = s1;
|
|
|
|
|
>s2 : Symbol(s2, Decl(intersectionReduction.ts, 86, 11))
|
|
|
|
|
>s1 : Symbol(s1, Decl(intersectionReduction.ts, 85, 11))
|
|
|
|
|
>s2 : Symbol(s2, Decl(intersectionReduction.ts, 87, 11))
|
|
|
|
|
>s1 : Symbol(s1, Decl(intersectionReduction.ts, 86, 11))
|
|
|
|
|
|
|
|
|
|
t1 = t2;
|
|
|
|
|
>t1 : Symbol(t1, Decl(intersectionReduction.ts, 88, 11))
|
|
|
|
|
>t2 : Symbol(t2, Decl(intersectionReduction.ts, 89, 11))
|
|
|
|
|
>t1 : Symbol(t1, Decl(intersectionReduction.ts, 89, 11))
|
|
|
|
|
>t2 : Symbol(t2, Decl(intersectionReduction.ts, 90, 11))
|
|
|
|
|
|
|
|
|
|
t2 = t1;
|
|
|
|
|
>t2 : Symbol(t2, Decl(intersectionReduction.ts, 89, 11))
|
|
|
|
|
>t1 : Symbol(t1, Decl(intersectionReduction.ts, 88, 11))
|
|
|
|
|
>t2 : Symbol(t2, Decl(intersectionReduction.ts, 90, 11))
|
|
|
|
|
>t1 : Symbol(t1, Decl(intersectionReduction.ts, 89, 11))
|
|
|
|
|
|
|
|
|
|
// Repro from #36736
|
|
|
|
|
|
|
|
|
|
const f1 = (t: "a" | ("b" & "c")): "a" => t;
|
|
|
|
|
>f1 : Symbol(f1, Decl(intersectionReduction.ts, 99, 5))
|
|
|
|
|
>t : Symbol(t, Decl(intersectionReduction.ts, 99, 12))
|
|
|
|
|
>t : Symbol(t, Decl(intersectionReduction.ts, 99, 12))
|
|
|
|
|
>f1 : Symbol(f1, Decl(intersectionReduction.ts, 100, 5))
|
|
|
|
|
>t : Symbol(t, Decl(intersectionReduction.ts, 100, 12))
|
|
|
|
|
>t : Symbol(t, Decl(intersectionReduction.ts, 100, 12))
|
|
|
|
|
|
|
|
|
|
type Container<Type extends string> = {
|
|
|
|
|
>Container : Symbol(Container, Decl(intersectionReduction.ts, 99, 44))
|
|
|
|
|
>Type : Symbol(Type, Decl(intersectionReduction.ts, 101, 15))
|
|
|
|
|
>Container : Symbol(Container, Decl(intersectionReduction.ts, 100, 44))
|
|
|
|
|
>Type : Symbol(Type, Decl(intersectionReduction.ts, 102, 15))
|
|
|
|
|
|
|
|
|
|
type: Type;
|
|
|
|
|
>type : Symbol(type, Decl(intersectionReduction.ts, 101, 39))
|
|
|
|
|
>Type : Symbol(Type, Decl(intersectionReduction.ts, 101, 15))
|
|
|
|
|
>type : Symbol(type, Decl(intersectionReduction.ts, 102, 39))
|
|
|
|
|
>Type : Symbol(Type, Decl(intersectionReduction.ts, 102, 15))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const f2 = (t: Container<"a"> | (Container<"b"> & Container<"c">)): Container<"a"> => t;
|
|
|
|
|
>f2 : Symbol(f2, Decl(intersectionReduction.ts, 105, 5))
|
|
|
|
|
>t : Symbol(t, Decl(intersectionReduction.ts, 105, 12))
|
|
|
|
|
>Container : Symbol(Container, Decl(intersectionReduction.ts, 99, 44))
|
|
|
|
|
>Container : Symbol(Container, Decl(intersectionReduction.ts, 99, 44))
|
|
|
|
|
>Container : Symbol(Container, Decl(intersectionReduction.ts, 99, 44))
|
|
|
|
|
>Container : Symbol(Container, Decl(intersectionReduction.ts, 99, 44))
|
|
|
|
|
>t : Symbol(t, Decl(intersectionReduction.ts, 105, 12))
|
|
|
|
|
>f2 : Symbol(f2, Decl(intersectionReduction.ts, 106, 5))
|
|
|
|
|
>t : Symbol(t, Decl(intersectionReduction.ts, 106, 12))
|
|
|
|
|
>Container : Symbol(Container, Decl(intersectionReduction.ts, 100, 44))
|
|
|
|
|
>Container : Symbol(Container, Decl(intersectionReduction.ts, 100, 44))
|
|
|
|
|
>Container : Symbol(Container, Decl(intersectionReduction.ts, 100, 44))
|
|
|
|
|
>Container : Symbol(Container, Decl(intersectionReduction.ts, 100, 44))
|
|
|
|
|
>t : Symbol(t, Decl(intersectionReduction.ts, 106, 12))
|
|
|
|
|
|
|
|
|
|
const f3 = (t: Container<"a"> | (Container<"b"> & { dataB: boolean } & Container<"a">)): Container<"a"> => t;
|
|
|
|
|
>f3 : Symbol(f3, Decl(intersectionReduction.ts, 106, 5))
|
|
|
|
|
>t : Symbol(t, Decl(intersectionReduction.ts, 106, 12))
|
|
|
|
|
>Container : Symbol(Container, Decl(intersectionReduction.ts, 99, 44))
|
|
|
|
|
>Container : Symbol(Container, Decl(intersectionReduction.ts, 99, 44))
|
|
|
|
|
>dataB : Symbol(dataB, Decl(intersectionReduction.ts, 106, 51))
|
|
|
|
|
>Container : Symbol(Container, Decl(intersectionReduction.ts, 99, 44))
|
|
|
|
|
>Container : Symbol(Container, Decl(intersectionReduction.ts, 99, 44))
|
|
|
|
|
>t : Symbol(t, Decl(intersectionReduction.ts, 106, 12))
|
|
|
|
|
>f3 : Symbol(f3, Decl(intersectionReduction.ts, 107, 5))
|
|
|
|
|
>t : Symbol(t, Decl(intersectionReduction.ts, 107, 12))
|
|
|
|
|
>Container : Symbol(Container, Decl(intersectionReduction.ts, 100, 44))
|
|
|
|
|
>Container : Symbol(Container, Decl(intersectionReduction.ts, 100, 44))
|
|
|
|
|
>dataB : Symbol(dataB, Decl(intersectionReduction.ts, 107, 51))
|
|
|
|
|
>Container : Symbol(Container, Decl(intersectionReduction.ts, 100, 44))
|
|
|
|
|
>Container : Symbol(Container, Decl(intersectionReduction.ts, 100, 44))
|
|
|
|
|
>t : Symbol(t, Decl(intersectionReduction.ts, 107, 12))
|
|
|
|
|
|
|
|
|
|
const f4 = (t: number | (Container<"b"> & { dataB: boolean } & Container<"a">)): number => t;
|
|
|
|
|
>f4 : Symbol(f4, Decl(intersectionReduction.ts, 107, 5))
|
|
|
|
|
>t : Symbol(t, Decl(intersectionReduction.ts, 107, 12))
|
|
|
|
|
>Container : Symbol(Container, Decl(intersectionReduction.ts, 99, 44))
|
|
|
|
|
>dataB : Symbol(dataB, Decl(intersectionReduction.ts, 107, 43))
|
|
|
|
|
>Container : Symbol(Container, Decl(intersectionReduction.ts, 99, 44))
|
|
|
|
|
>t : Symbol(t, Decl(intersectionReduction.ts, 107, 12))
|
|
|
|
|
>f4 : Symbol(f4, Decl(intersectionReduction.ts, 108, 5))
|
|
|
|
|
>t : Symbol(t, Decl(intersectionReduction.ts, 108, 12))
|
|
|
|
|
>Container : Symbol(Container, Decl(intersectionReduction.ts, 100, 44))
|
|
|
|
|
>dataB : Symbol(dataB, Decl(intersectionReduction.ts, 108, 43))
|
|
|
|
|
>Container : Symbol(Container, Decl(intersectionReduction.ts, 100, 44))
|
|
|
|
|
>t : Symbol(t, Decl(intersectionReduction.ts, 108, 12))
|
|
|
|
|
|
|
|
|
|