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
But obviously, this way you can get into errors, with both the type and namespace potentially going out of sync due to human error.
Ideally, the very first line should in itself allow you to have autocomplete, similar to what enum does. Or alternatively of course support stringenum types.
The text was updated successfully, but these errors were encountered:
Let's say I have the following type:
It will be awesome if I can treat it like an enum, meaning I can write
Cars.
and get intellisense forFerari
,Volve
, andPorsche
.Today, you do not get that.
You can have funky workarounds to make the number based enum become a string
Like this (runnable sample):
But that's hacking, even though it opens the question why not make this a core feature.
Or, you can use namespaces, like (runnable sample):
But obviously, this way you can get into errors, with both the type and namespace potentially going out of sync due to human error.
Ideally, the very first line should in itself allow you to have autocomplete, similar to what enum does. Or alternatively of course support
string
enum
types.The text was updated successfully, but these errors were encountered: