1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
|
=== tests/cases/compiler/circularBaseTypes.ts ===
// Repro from #38098
type M<T> = { value: T };
>M : Symbol(M, Decl(circularBaseTypes.ts, 0, 0))
>T : Symbol(T, Decl(circularBaseTypes.ts, 2, 7))
>value : Symbol(value, Decl(circularBaseTypes.ts, 2, 13))
>T : Symbol(T, Decl(circularBaseTypes.ts, 2, 7))
interface M2 extends M<M3> {}; // Error
>M2 : Symbol(M2, Decl(circularBaseTypes.ts, 2, 25))
>M : Symbol(M, Decl(circularBaseTypes.ts, 0, 0))
>M3 : Symbol(M3, Decl(circularBaseTypes.ts, 3, 30))
type M3 = M2[keyof M2]; // Error
>M3 : Symbol(M3, Decl(circularBaseTypes.ts, 3, 30))
>M2 : Symbol(M2, Decl(circularBaseTypes.ts, 2, 25))
>M2 : Symbol(M2, Decl(circularBaseTypes.ts, 2, 25))
function f(m: M3) {
>f : Symbol(f, Decl(circularBaseTypes.ts, 4, 23))
>m : Symbol(m, Decl(circularBaseTypes.ts, 6, 11))
>M3 : Symbol(M3, Decl(circularBaseTypes.ts, 3, 30))
return m.value;
>m : Symbol(m, Decl(circularBaseTypes.ts, 6, 11))
}
// Repro from #32581
type X<T> = { [K in keyof T]: string } & { b: string };
>X : Symbol(X, Decl(circularBaseTypes.ts, 8, 1))
>T : Symbol(T, Decl(circularBaseTypes.ts, 12, 7))
>K : Symbol(K, Decl(circularBaseTypes.ts, 12, 15))
>T : Symbol(T, Decl(circularBaseTypes.ts, 12, 7))
>b : Symbol(b, Decl(circularBaseTypes.ts, 12, 42))
interface Y extends X<Y> {
>Y : Symbol(Y, Decl(circularBaseTypes.ts, 12, 55))
>X : Symbol(X, Decl(circularBaseTypes.ts, 8, 1))
>Y : Symbol(Y, Decl(circularBaseTypes.ts, 12, 55))
a: "";
>a : Symbol(Y.a, Decl(circularBaseTypes.ts, 13, 26))
}
|