Any possibility to make the below code compilable:
Copy code
abstract class SomeLibraryClass<T> {
abstract fun test(key: String): T
}
class Item<T : Enum<T>> : SomeLibraryClass<T>() {
override fun test(key: String): T {
return enumValueOf(key)
}
}
Can't make T as
reified
or
test
as inline. How can I inherit the library class for enum?
c
Cedrick Cooke
03/29/2022, 8:22 PM
Something like this would work. The
companion object
is totally optional, but it allows constructing via