TypeScript/tests/baselines/reference/genericSpecializations1.types

46 lines
2 KiB
Plaintext
Raw Normal View History

2014-08-15 23:33:16 +02:00
=== tests/cases/compiler/genericSpecializations1.ts ===
interface IFoo<T> {
2015-04-13 23:01:57 +02:00
>IFoo : IFoo<T>, Symbol(IFoo, Decl(genericSpecializations1.ts, 0, 0))
>T : T, Symbol(T, Decl(genericSpecializations1.ts, 0, 15))
2014-08-15 23:33:16 +02:00
foo<T>(x: T): T; // no error on implementors because IFoo's T is different from foo's T
2015-04-13 23:01:57 +02:00
>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))
2014-08-15 23:33:16 +02:00
}
class IntFooBad implements IFoo<number> {
2015-04-13 23:01:57 +02:00
>IntFooBad : IntFooBad, Symbol(IntFooBad, Decl(genericSpecializations1.ts, 2, 1))
>IFoo : IFoo<T>, Symbol(IFoo, Decl(genericSpecializations1.ts, 0, 0))
2014-08-15 23:33:16 +02:00
foo(x: string): string { return null; }
2015-04-13 23:01:57 +02:00
>foo : (x: string) => string, Symbol(foo, Decl(genericSpecializations1.ts, 4, 41))
>x : string, Symbol(x, Decl(genericSpecializations1.ts, 5, 8))
2015-04-13 21:36:11 +02:00
>null : null
2014-08-15 23:33:16 +02:00
}
class StringFoo2 implements IFoo<string> {
2015-04-13 23:01:57 +02:00
>StringFoo2 : StringFoo2, Symbol(StringFoo2, Decl(genericSpecializations1.ts, 6, 1))
>IFoo : IFoo<T>, Symbol(IFoo, Decl(genericSpecializations1.ts, 0, 0))
2014-08-15 23:33:16 +02:00
foo(x: string): string { return null; }
2015-04-13 23:01:57 +02:00
>foo : (x: string) => string, Symbol(foo, Decl(genericSpecializations1.ts, 8, 42))
>x : string, Symbol(x, Decl(genericSpecializations1.ts, 9, 8))
2015-04-13 21:36:11 +02:00
>null : null
2014-08-15 23:33:16 +02:00
}
class StringFoo3 implements IFoo<string> {
2015-04-13 23:01:57 +02:00
>StringFoo3 : StringFoo3, Symbol(StringFoo3, Decl(genericSpecializations1.ts, 10, 1))
>IFoo : IFoo<T>, Symbol(IFoo, Decl(genericSpecializations1.ts, 0, 0))
2014-08-15 23:33:16 +02:00
foo<T>(x: T): T { return null; }
2015-04-13 23:01:57 +02:00
>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))
2015-04-13 21:36:11 +02:00
>null : null
2014-08-15 23:33:16 +02:00
}