60 lines
1.9 KiB
Text
60 lines
1.9 KiB
Text
=== tests/cases/compiler/genericImplements.ts ===
|
|
class A { a; };
|
|
>A : Symbol(A, Decl(genericImplements.ts, 0, 0))
|
|
>a : Symbol(A.a, Decl(genericImplements.ts, 0, 9))
|
|
|
|
class B { b; };
|
|
>B : Symbol(B, Decl(genericImplements.ts, 0, 15))
|
|
>b : Symbol(B.b, Decl(genericImplements.ts, 1, 9))
|
|
|
|
interface I {
|
|
>I : Symbol(I, Decl(genericImplements.ts, 1, 15))
|
|
|
|
f<T extends A>(): T;
|
|
>f : Symbol(I.f, Decl(genericImplements.ts, 2, 13))
|
|
>T : Symbol(T, Decl(genericImplements.ts, 3, 6))
|
|
>A : Symbol(A, Decl(genericImplements.ts, 0, 0))
|
|
>T : Symbol(T, Decl(genericImplements.ts, 3, 6))
|
|
|
|
} // { f: () => { a; } }
|
|
|
|
// OK
|
|
class X implements I {
|
|
>X : Symbol(X, Decl(genericImplements.ts, 4, 1))
|
|
>I : Symbol(I, Decl(genericImplements.ts, 1, 15))
|
|
|
|
f<T extends B>(): T { return undefined; }
|
|
>f : Symbol(X.f, Decl(genericImplements.ts, 7, 22))
|
|
>T : Symbol(T, Decl(genericImplements.ts, 8, 6))
|
|
>B : Symbol(B, Decl(genericImplements.ts, 0, 15))
|
|
>T : Symbol(T, Decl(genericImplements.ts, 8, 6))
|
|
>undefined : Symbol(undefined)
|
|
|
|
} // { f: () => { b; } }
|
|
|
|
// OK
|
|
class Y implements I {
|
|
>Y : Symbol(Y, Decl(genericImplements.ts, 9, 1))
|
|
>I : Symbol(I, Decl(genericImplements.ts, 1, 15))
|
|
|
|
f<T extends A>(): T { return undefined; }
|
|
>f : Symbol(Y.f, Decl(genericImplements.ts, 12, 22))
|
|
>T : Symbol(T, Decl(genericImplements.ts, 13, 6))
|
|
>A : Symbol(A, Decl(genericImplements.ts, 0, 0))
|
|
>T : Symbol(T, Decl(genericImplements.ts, 13, 6))
|
|
>undefined : Symbol(undefined)
|
|
|
|
} // { f: () => { a; } }
|
|
|
|
// OK
|
|
class Z implements I {
|
|
>Z : Symbol(Z, Decl(genericImplements.ts, 14, 1))
|
|
>I : Symbol(I, Decl(genericImplements.ts, 1, 15))
|
|
|
|
f<T>(): T { return undefined; }
|
|
>f : Symbol(Z.f, Decl(genericImplements.ts, 17, 22))
|
|
>T : Symbol(T, Decl(genericImplements.ts, 18, 6))
|
|
>T : Symbol(T, Decl(genericImplements.ts, 18, 6))
|
|
>undefined : Symbol(undefined)
|
|
|
|
} // { f: <T>() => T }
|