41dc625b0a
* Add static index * fix lint * make lint happy * adjust test cases * add more cases * fix changes * Add more case * accept baseline * fix error if extends others * Update vfsUtil.ts * use equal to empty array * static signature of interface is an error * Accept baseline * Check index constraints for static signature * Accpet baseline * Fix crash * fix crash * Accept baseline * Fix regression * Fix crash * always return new array
52 lines
693 B
Plaintext
52 lines
693 B
Plaintext
=== 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
|
|
|