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
Feature suggestion: Compile-time reflection of string literal unions and enums #9182
It would be useful to have a way to refer to the possible values at runtime:
something like __valuesof(Fish) would transpile to ["one" , "two" , "red", "blue"] in both cases.
Also consider __enummap(Fish) that would transpile to
{
"one":1,
"two":2,
"red":3,
"blue":4
}
or explicit enum values if specified. This would allow C#'s Enum.Parse functionality
The issue of type serialization/"reflection" has been discussed multiple times (#2902, #2577, #3060). we already have #3628 to track this discussion; so i suggest moving this proposal to that issue.
Activity
mhegazy commentedon Jun 15, 2016
The issue of type serialization/"reflection" has been discussed multiple times (#2902, #2577, #3060). we already have #3628 to track this discussion; so i suggest moving this proposal to that issue.