* 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
29 lines
1.5 KiB
Plaintext
29 lines
1.5 KiB
Plaintext
tests/cases/conformance/classes/staticIndexSignature/staticIndexSignature2.ts(6,1): error TS2542: Index signature in type 'typeof C' only permits reading.
|
|
tests/cases/conformance/classes/staticIndexSignature/staticIndexSignature2.ts(7,1): error TS2542: Index signature in type 'typeof C' only permits reading.
|
|
tests/cases/conformance/classes/staticIndexSignature/staticIndexSignature2.ts(9,1): error TS2542: Index signature in type 'typeof C' only permits reading.
|
|
tests/cases/conformance/classes/staticIndexSignature/staticIndexSignature2.ts(10,1): error TS2322: Type '2' is not assignable to type '42'.
|
|
tests/cases/conformance/classes/staticIndexSignature/staticIndexSignature2.ts(10,1): error TS2542: Index signature in type 'typeof C' only permits reading.
|
|
|
|
|
|
==== tests/cases/conformance/classes/staticIndexSignature/staticIndexSignature2.ts (5 errors) ====
|
|
class C {
|
|
static readonly [s: string]: number;
|
|
static readonly [s: number]: 42
|
|
}
|
|
|
|
C["foo"] = 1
|
|
~~~~~~~~
|
|
!!! error TS2542: Index signature in type 'typeof C' only permits reading.
|
|
C.bar = 2;
|
|
~~~~~
|
|
!!! error TS2542: Index signature in type 'typeof C' only permits reading.
|
|
const foo = C["foo"]
|
|
C[42] = 42
|
|
~~~~~
|
|
!!! error TS2542: Index signature in type 'typeof C' only permits reading.
|
|
C[2] = 2;
|
|
~~~~
|
|
!!! error TS2322: Type '2' is not assignable to type '42'.
|
|
~~~~
|
|
!!! error TS2542: Index signature in type 'typeof C' only permits reading.
|
|
const bar = C[42] |