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
|
=== tests/cases/conformance/classes/members/classTypes/indexersInClassType.ts ===
class C {
>C : C
[x: number]: Date;
>x : number
>Date : Date
[x: string]: Object;
>x : string
>Object : Object
1: Date;
>Date : Date
'a': {}
fn() {
>fn : () => this
return this;
>this : this
}
}
var c = new C();
>c : C
>new C() : C
>C : typeof C
var r = c.fn();
>r : C
>c.fn() : C
>c.fn : () => C
>c : C
>fn : () => C
var r2 = r[1];
>r2 : Date
>r[1] : Date
>r : C
>1 : 1
var r3 = r.a
>r3 : {}
>r.a : {}
>r : C
>a : {}
|