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
{{ message }}
Repository navigation
Const enum initializer rejects a const variable initialized from an enum member #3640
SharpTS at 89311999a rejects this with --no-tsconfig --strict --noEmit: Expression type 'Variable' is not allowed in const enum initializer.
TypeScript 6.0.3 accepts it with --ignoreConfig --strict --target ES2022, and its emitted JavaScript prints 4.
The enum constant recorder handles literal, variable, grouping, unary and binary const initializers, but does not record a constant whose initializer is a qualified enum member. The intervening const variable should retain the enum member's constant value. Found while verifying qualified enum member initializer support for #3630. This is distinct from referring to Source.A directly in the enum initializer.
Activity