-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Closed as not planned
Labels
DuplicateAn existing issue was already createdAn existing issue was already created
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?
Additional information about the issue
kirkwaiblinger
Metadata
Metadata
Assignees
Labels
DuplicateAn existing issue was already createdAn existing issue was already created