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
|
=== tests/cases/compiler/staticMemberWithStringAndNumberNames.ts ===
class C {
>C : C
static "foo" = 0;
>"foo" : number
>0 : 0
static 0 = 1;
>0 : number
>1 : 1
x = C['foo'];
>x : number
>C['foo'] : number
>C : typeof C
>'foo' : "foo"
x2 = C['0'];
>x2 : number
>C['0'] : number
>C : typeof C
>'0' : "0"
x3 = C[0];
>x3 : number
>C[0] : number
>C : typeof C
>0 : 0
static s = C['foo'];
>s : number
>C['foo'] : number
>C : typeof C
>'foo' : "foo"
static s2 = C['0'];
>s2 : number
>C['0'] : number
>C : typeof C
>'0' : "0"
static s3 = C[0];
>s3 : number
>C[0] : number
>C : typeof C
>0 : 0
}
|