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
This is working as intended. From the documentation you linked:
numeric enums members also get a reverse mapping from enum values to enum names.
[...]
Keep in mind that string enum members do not get a reverse mapping generated at all.
You don't have any numeric enum members. You only have string enum members.
π Search Terms
enum reverse mapping
π Version & Regression Information
This is the behavior in every version I tried, and I reviewed the FAQ for entries about enums or reverse mapping
β― Playground Link
https://www.typescriptlang.org/play/?ts=5.8.2#code/PQKhCgAIUhRA7ArgW0gJwKYAdMGcPwAuAlvAOaQBGpAhmgJ6QD2WGaNhTauAdFCMHAYAHli6FIBFJABCtBgHlW7TmnABvKJG2wAjohoAbSAF5IAchMnzAGi3aAyoTTEAxoT0HjZy1dv3IADkmD30jUwsAQms7bUdnN0Jg0K8I82iYgIAZDFxcABUACxp4NIAefzjIHLyikoU0T3CfMsyqgHFMDjY60p8APkq4zoxutF6Gpu8Lfra4gEF4ABM0gDJVoe0GtIAfHc3IAFlSRFw0gFoDgAVDU7SAagPDpiXEQyY0gFIDgBFiADc0sADvliMhcmkQNcmAB3NIAPV+ITSPAOAEVELkSEx4D9kT4APyo2JxABiXGQHDSAGIDgBVeAAa3gsL6FmE5nAAF9wEA
π» Code
π Actual behavior
Reverse mapping is not generated
π Expected behavior
Reverse mapping should be generated as stated in https://www.typescriptlang.org/docs/handbook/enums.html#reverse-mappings
Additional information about the issue
No response
The text was updated successfully, but these errors were encountered: