You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Parser fails if computed property is provided as key of enum, this synatx should be allowed only for computed properties with string literal value or template literal without arguments.
// should workenumFoo{['baz']}// ❌ currently failsenumFoo{[`baz`]}// ❌ currently failsenumFoo{['baz']=2}// ❌ currently failsenumFoo{[`baz`]=2}// ❌ currently failsenumFoo{'baz'}// 👍 work fineenumFoo{baz}// 👍 work fineenumFoo{'baz'=2}// 👍 work fineenumFoo{baz=2}// 👍 work fine// should failenumFoo{[foo]}// Computed property names are not allowed in enumsenumFoo{[1]}// An enum member cannot have a numeric name.enumFoo{[`test${foo}`]}// Computed property names are not allowed in enums.enumFoo{`baz`=2}// Enum member expected.enumFoo{['baz'+'baz']}// Computed property names are not allowed in enums.
Parser fails if computed property is provided as key of enum, this synatx should be allowed only for computed properties with string literal value or template literal without arguments.
ref microsoft/TypeScript#42468
The text was updated successfully, but these errors were encountered: