is there a way i can use the `class` of my generic...
# announcements
d
is there a way i can use the
class
of my generic? my construct looks like this:
Copy code
abstract class Base<T: Parent> {
 val something: MyGenericClass<T>(T::class.java)
}
but it says i cant use
T
as reified type parameter and should use a class instead.
s
T
will be erased at runtime, so
T
will be not known inside
Base
instance
k
You could create a factory function with a
reified
type parameter that calls the constructor with the class instance.