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
Sometimes you want to print out the case name for a C/ObjC enum (and in the future, C++), but today print will print the type name. You don't get a string for the case name.
Instead we could support conformance synthesis, using some syntax like
extensionTheEnum: CustomStringConvertible { }
This would generate the description method + switch statement without having the user tediously implement it. Or we could generate a table of case names and somehow use that directly.
The naive strategy of generating case names for every imported foreign enum would lead to greater code-size; using explicit conformances would avoid that issue.
The text was updated successfully, but these errors were encountered:
Additional Detail from JIRA
md5: 16c48f6beb706f52c363cc0c939a1955
Issue Description:
Sometimes you want to print out the case name for a C/ObjC enum (and in the future, C++), but today
print
will print the type name. You don't get a string for the case name.Instead we could support conformance synthesis, using some syntax like
This would generate the description method + switch statement without having the user tediously implement it. Or we could generate a table of case names and somehow use that directly.
The naive strategy of generating case names for every imported foreign enum would lead to greater code-size; using explicit conformances would avoid that issue.
The text was updated successfully, but these errors were encountered: