mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
26 lines
442 B
TypeScript
26 lines
442 B
TypeScript
//// [tests/cases/conformance/classes/staticIndexSignature/staticIndexSignature1.ts] ////
|
|
|
|
//// [staticIndexSignature1.ts]
|
|
class C {
|
|
static [s: string]: number;
|
|
static [s: number]: 42
|
|
}
|
|
|
|
C["foo"] = 1
|
|
C.bar = 2;
|
|
const foo = C["foo"]
|
|
C[42] = 42
|
|
C[2] = 2;
|
|
const bar = C[42]
|
|
|
|
//// [staticIndexSignature1.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];
|