TypeScript/tests/cases/compiler/constEnumSyntheticNodesComments.ts
Andrii Dieiev a34fdb203e Better template literals support in checker (#32064)
* Support template literals in enum declarations

* Support template literals in const enum access

* Support template literals in swith with typeof narrowing

* Support template literals in element access discriminant

* Support template literals in ambient module declaration

* Unify symbols for template literals in computed properties

* Unify expression position checks for template literals

* Support template literals in rename and find all references

* Mark computed properties with template literals as write access

* Inline startsWithQuote
2019-09-27 12:04:13 -07:00

18 lines
362 B
TypeScript

const enum En { A, B, C, D }
function assert<T>(x: T) {
return x;
}
function verify(a: En) {
switch (a) {
case En.A:
return assert<0>(a);
case En["B"]:
return assert<1>(a);
case En[`C`]:
return assert<2>(a);
case En["\u{44}"]:
return assert<3>(a);
}
}