mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
30 lines
528 B
TypeScript
30 lines
528 B
TypeScript
//// [tests/cases/conformance/expressions/elementAccess/stringEnumInElementAccess01.ts] ////
|
|
|
|
//// [stringEnumInElementAccess01.ts]
|
|
enum E {
|
|
A = "a",
|
|
B = "b",
|
|
C = "c",
|
|
}
|
|
|
|
interface Item {
|
|
a: string;
|
|
b: number;
|
|
c: boolean;
|
|
}
|
|
|
|
declare const item: Item;
|
|
declare const e: E;
|
|
const snb: string | number | boolean = item[e];
|
|
|
|
|
|
//// [stringEnumInElementAccess01.js]
|
|
"use strict";
|
|
var E;
|
|
(function (E) {
|
|
E["A"] = "a";
|
|
E["B"] = "b";
|
|
E["C"] = "c";
|
|
})(E || (E = {}));
|
|
const snb = item[e];
|