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
Not possible to use const string as enum valueΒ #61064
constoption2='option2';constoption3='option3'asconst;exportenumTestEnum{Option1='option1',Option2=option2,// <<< no errors hereOption3=option3,// <<< ts(18033) error here}
π Actual behavior
Blocked by ts(18033) error
π Expected behavior
No ts(18033) error
Additional information about the issue
When string variable created as const it's impossible to use it as an enum value because of ts(18033) error.
As far as I'm aware this behaviour should've been implemented as part of this issue #40793
Activity
MartinJohns commentedon Jan 28, 2025
Duplicate of #59346. The related PR has not been merged yet: #59475
typescript-bot commentedon Jan 31, 2025
This issue has been marked as "Duplicate" and has seen no recent activity. It has been automatically closed for house-keeping purposes.