Closed as not planned
Description
π Search Terms
enum, computed, member key, string
π Version & Regression Information
This is the behavior in every version I tried.
β― Playground Link
π» Code
enum Foo {
['A'] = 1
}
π Actual behavior
"use strict";
var Foo;
(function (Foo) {
Foo[Foo['A'] = 1] = 'A';
})(Foo || (Foo = {}));
π Expected behavior
When using
enum Foo {
[A] = 1
}
it emits error
Computed property names are not allowed in enums.
Should we forbid computed strings as well?