mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
26 lines
460 B
TypeScript
26 lines
460 B
TypeScript
//// [tests/cases/conformance/classes/staticIndexSignature/staticIndexSignature2.ts] ////
|
|
|
|
//// [staticIndexSignature2.ts]
|
|
class C {
|
|
static readonly [s: string]: number;
|
|
static readonly [s: number]: 42
|
|
}
|
|
|
|
C["foo"] = 1
|
|
C.bar = 2;
|
|
const foo = C["foo"]
|
|
C[42] = 42
|
|
C[2] = 2;
|
|
const bar = C[42]
|
|
|
|
//// [staticIndexSignature2.js]
|
|
"use strict";
|
|
class C {
|
|
}
|
|
C["foo"] = 1;
|
|
C.bar = 2;
|
|
const foo = C["foo"];
|
|
C[42] = 42;
|
|
C[2] = 2;
|
|
const bar = C[42];
|