make @tagName
of non-exhaustive enums return an optional
#12845
Labels
Milestone
@tagName
of non-exhaustive enums return an optional
#12845
Extracted from #7320.
Currently,
@tagName
for a non-exhaustive enum asserts that the integer has a corresponding tag name:This proposal is to change
@tagName
to return an optional in this case. Previous behavior can be obtained by adding.?
to the end of the@tagName
call.The compile errors at each
@tagName
callsite that would be introduced when changing an enum to and from a non-exhaustive enum are helpful and desirable.The text was updated successfully, but these errors were encountered: