1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
|
=== tests/cases/conformance/classes/members/constructorFunctionTypes/classWithStaticMembers.ts ===
class C {
>C : C
static fn() { return this; }
>fn : () => typeof C
>this : typeof C
static get x() { return 1; }
>x : number
>1 : 1
static set x(v) { }
>x : number
>v : number
constructor(public a: number, private b: number) { }
>a : number
>b : number
static foo: string;
>foo : string
}
var r = C.fn();
>r : typeof C
>C.fn() : typeof C
>C.fn : () => typeof C
>C : typeof C
>fn : () => typeof C
var r2 = r.x;
>r2 : number
>r.x : number
>r : typeof C
>x : number
var r3 = r.foo;
>r3 : string
>r.foo : string
>r : typeof C
>foo : string
class D extends C {
>D : D
>C : C
bar: string;
>bar : string
}
var r = D.fn();
>r : typeof C
>D.fn() : typeof C
>D.fn : () => typeof C
>D : typeof D
>fn : () => typeof C
var r2 = r.x;
>r2 : number
>r.x : number
>r : typeof C
>x : number
var r3 = r.foo;
>r3 : string
>r.foo : string
>r : typeof C
>foo : string
|