TypeScript/tests/baselines/reference/constructorHasPrototypeProperty.types

101 lines
1.4 KiB
Plaintext
Raw Normal View History

2014-08-15 23:33:16 +02:00
=== tests/cases/conformance/classes/members/constructorFunctionTypes/constructorHasPrototypeProperty.ts ===
module NonGeneric {
>NonGeneric : typeof NonGeneric
2014-08-15 23:33:16 +02:00
class C {
>C : C
2014-08-15 23:33:16 +02:00
foo: string;
>foo : string
2014-08-15 23:33:16 +02:00
}
class D extends C {
>D : D
>C : C
2014-08-15 23:33:16 +02:00
bar: string;
>bar : string
2014-08-15 23:33:16 +02:00
}
var r = C.prototype;
>r : C
>C.prototype : C
>C : typeof C
>prototype : C
2014-08-15 23:33:16 +02:00
r.foo;
>r.foo : string
>r : C
>foo : string
2014-08-15 23:33:16 +02:00
var r2 = D.prototype;
>r2 : D
>D.prototype : D
>D : typeof D
>prototype : D
2014-08-15 23:33:16 +02:00
r2.bar;
>r2.bar : string
>r2 : D
>bar : string
2014-08-15 23:33:16 +02:00
}
module Generic {
>Generic : typeof Generic
2014-08-15 23:33:16 +02:00
class C<T,U> {
>C : C<T, U>
>T : T
>U : U
2014-08-15 23:33:16 +02:00
foo: T;
>foo : T
>T : T
2014-08-15 23:33:16 +02:00
bar: U;
>bar : U
>U : U
2014-08-15 23:33:16 +02:00
}
class D<T,U> extends C<T,U> {
>D : D<T, U>
>T : T
>U : U
>C : C<T, U>
>T : T
>U : U
2014-08-15 23:33:16 +02:00
baz: T;
>baz : T
>T : T
2014-08-15 23:33:16 +02:00
bing: U;
>bing : U
>U : U
2014-08-15 23:33:16 +02:00
}
var r = C.prototype; // C<any, any>
>r : C<any, any>
>C.prototype : C<any, any>
>C : typeof C
>prototype : C<any, any>
2014-08-15 23:33:16 +02:00
var ra = r.foo; // any
>ra : any
>r.foo : any
>r : C<any, any>
>foo : any
2014-08-15 23:33:16 +02:00
var r2 = D.prototype; // D<any, any>
>r2 : D<any, any>
>D.prototype : D<any, any>
>D : typeof D
>prototype : D<any, any>
2014-08-15 23:33:16 +02:00
var rb = r2.baz; // any
>rb : any
>r2.baz : any
>r2 : D<any, any>
>baz : any
2014-08-15 23:33:16 +02:00
}