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 }}
This repository has been archived by the owner on Jun 5, 2023. It is now read-only.
constValue[E.C.type] should provide C and other parameter-less cases
Mirror.Sum should have valueOf, the same way how E has valueOf
None of the above is present in dotty as of now.
Use case - I have a bunch of enums for which I want to derive a type-class. The mapping is the very simplest possible - the name of the enum value determines the target instance. Hence the usage of the valueOf, or any other way of instantiating the enum case based on name only.
The text was updated successfully, but these errors were encountered:
letalvoj
changed the title
Access to enum values from generic functions
constValue for singleton enum cases
May 24, 2020
Let's have an enum
I'd expect one of the following to be possible:
constValue[E.C.type]
should provideC
and other parameter-less casesMirror.Sum
should havevalueOf
, the same way howE
hasvalueOf
None of the above is present in dotty as of now.
Use case - I have a bunch of enums for which I want to derive a type-class. The mapping is the very simplest possible - the name of the enum value determines the target instance. Hence the usage of the
valueOf
, or any other way of instantiating the enum case based on name only.The text was updated successfully, but these errors were encountered: