I was toying around with creating an annotation intended to allow specification of a default Enum value.
annotation class DefaultEnumValue<T: Enum<T>>(val value: T)
I get a compiler error stating that T is an “invalid type of annotation member.” Enums are definitely valid annotation members. Is type erasure the reason that something like this is not possible?
Seems like constraining T to be of type Enum would force this type to be an enum type.
Is there a way to achieve this with different syntax?