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
|
=== tests/cases/conformance/classes/staticIndexSignature/staticIndexSignature1.ts ===
class C {
>C : C
static [s: string]: number;
>s : string
static [s: number]: 42
>s : number
}
C["foo"] = 1
>C["foo"] = 1 : 1
>C["foo"] : number
>C : typeof C
>"foo" : "foo"
>1 : 1
C.bar = 2;
>C.bar = 2 : 2
>C.bar : number
>C : typeof C
>bar : number
>2 : 2
const foo = C["foo"]
>foo : number
>C["foo"] : number
>C : typeof C
>"foo" : "foo"
C[42] = 42
>C[42] = 42 : 42
>C[42] : 42
>C : typeof C
>42 : 42
>42 : 42
C[2] = 2;
>C[2] = 2 : 2
>C[2] : 42
>C : typeof C
>2 : 2
>2 : 2
const bar = C[42]
>bar : 42
>C[42] : 42
>C : typeof C
>42 : 42
|