TypeScript/tests/baselines/reference/genericPrototypeProperty.types

39 lines
529 B
Plaintext
Raw Normal View History

2014-08-15 23:33:16 +02:00
=== tests/cases/compiler/genericPrototypeProperty.ts ===
class C<T> {
>C : C<T>
>T : T
2014-08-15 23:33:16 +02:00
x: T;
>x : T
>T : T
2014-08-15 23:33:16 +02:00
foo(x: T): T { return null; }
>foo : (x: T) => T
>x : T
>T : T
>T : T
2015-04-13 21:36:11 +02:00
>null : null
2014-08-15 23:33:16 +02:00
}
var r = C.prototype;
>r : C<any>
>C.prototype : C<any>
>C : typeof C
>prototype : C<any>
2014-08-15 23:33:16 +02:00
// should be any
var r2 = r.x
>r2 : any
>r.x : any
>r : C<any>
>x : any
2014-08-15 23:33:16 +02:00
var r3 = r.foo(null);
>r3 : any
2014-08-15 23:33:16 +02:00
>r.foo(null) : any
>r.foo : (x: any) => any
>r : C<any>
>foo : (x: any) => any
2015-04-13 21:36:11 +02:00
>null : null
2014-08-15 23:33:16 +02:00