chansek
03/29/2022, 6:04 PMabstract 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?Cedrick Cooke
03/29/2022, 8:22 PMcompanion object
is totally optional, but it allows constructing via Item<Foobar>()
instead of Item(Foobar::class.java)
chansek
03/30/2022, 6:22 AM