46 lines
2 KiB
Plaintext
46 lines
2 KiB
Plaintext
=== tests/cases/compiler/genericSpecializations1.ts ===
|
|
interface IFoo<T> {
|
|
>IFoo : IFoo<T>, Symbol(IFoo, Decl(genericSpecializations1.ts, 0, 0))
|
|
>T : T, Symbol(T, Decl(genericSpecializations1.ts, 0, 15))
|
|
|
|
foo<T>(x: T): T; // no error on implementors because IFoo's T is different from foo's T
|
|
>foo : <T>(x: T) => T, Symbol(foo, Decl(genericSpecializations1.ts, 0, 19))
|
|
>T : T, Symbol(T, Decl(genericSpecializations1.ts, 1, 8))
|
|
>x : T, Symbol(x, Decl(genericSpecializations1.ts, 1, 11))
|
|
>T : T, Symbol(T, Decl(genericSpecializations1.ts, 1, 8))
|
|
>T : T, Symbol(T, Decl(genericSpecializations1.ts, 1, 8))
|
|
}
|
|
|
|
class IntFooBad implements IFoo<number> {
|
|
>IntFooBad : IntFooBad, Symbol(IntFooBad, Decl(genericSpecializations1.ts, 2, 1))
|
|
>IFoo : IFoo<T>, Symbol(IFoo, Decl(genericSpecializations1.ts, 0, 0))
|
|
|
|
foo(x: string): string { return null; }
|
|
>foo : (x: string) => string, Symbol(foo, Decl(genericSpecializations1.ts, 4, 41))
|
|
>x : string, Symbol(x, Decl(genericSpecializations1.ts, 5, 8))
|
|
>null : null
|
|
}
|
|
|
|
class StringFoo2 implements IFoo<string> {
|
|
>StringFoo2 : StringFoo2, Symbol(StringFoo2, Decl(genericSpecializations1.ts, 6, 1))
|
|
>IFoo : IFoo<T>, Symbol(IFoo, Decl(genericSpecializations1.ts, 0, 0))
|
|
|
|
foo(x: string): string { return null; }
|
|
>foo : (x: string) => string, Symbol(foo, Decl(genericSpecializations1.ts, 8, 42))
|
|
>x : string, Symbol(x, Decl(genericSpecializations1.ts, 9, 8))
|
|
>null : null
|
|
}
|
|
|
|
class StringFoo3 implements IFoo<string> {
|
|
>StringFoo3 : StringFoo3, Symbol(StringFoo3, Decl(genericSpecializations1.ts, 10, 1))
|
|
>IFoo : IFoo<T>, Symbol(IFoo, Decl(genericSpecializations1.ts, 0, 0))
|
|
|
|
foo<T>(x: T): T { return null; }
|
|
>foo : <T>(x: T) => T, Symbol(foo, Decl(genericSpecializations1.ts, 12, 42))
|
|
>T : T, Symbol(T, Decl(genericSpecializations1.ts, 13, 8))
|
|
>x : T, Symbol(x, Decl(genericSpecializations1.ts, 13, 11))
|
|
>T : T, Symbol(T, Decl(genericSpecializations1.ts, 13, 8))
|
|
>T : T, Symbol(T, Decl(genericSpecializations1.ts, 13, 8))
|
|
>null : null
|
|
}
|