natpryce
10/30/2018, 8:34 AMlouiscad
10/30/2018, 8:36 AMcompanion object
with operator fun invoke
to have this behavior. If the class is open or abstract, you need to do it for child classes toonatpryce
10/30/2018, 8:39 AMlouiscad
10/30/2018, 8:40 AMnatpryce
10/30/2018, 8:46 AMnatpryce
10/30/2018, 8:46 AMnatpryce
10/30/2018, 8:47 AMkarelpeeters
10/30/2018, 8:53 AMDico
10/30/2018, 10:04 AMfun ClassName(): ClassName
Next to the class over operator fun invoke()
in the companion object. Just putting it out there @louiscadnatpryce
10/30/2018, 10:12 AMkarelpeeters
10/30/2018, 10:56 AMchristophsturm
10/30/2018, 12:44 PMdiesieben07
11/01/2018, 3:14 PMreified T
than in a Class<T>
. In fact there is no runtime type (except maybe something like Guava's TypeToken
) that can accurately represent what a reified T
is.karelpeeters
11/01/2018, 3:18 PMreified T
that you can't do with a Class<T>
?diesieben07
11/01/2018, 3:39 PMinline
functions that have a reified T
, for example. Or you can do val x = object : SomeClass<T>
and have T
properly encoded in the classfile.diesieben07
11/01/2018, 3:40 PMkarelpeeters
11/01/2018, 3:40 PMdiesieben07
11/01/2018, 3:41 PMkarelpeeters
11/01/2018, 3:42 PMreified
is more powerful, which just leads back to the same question.karelpeeters
11/01/2018, 3:42 PMdiesieben07
11/01/2018, 3:43 PMdmitry.petrov
11/02/2018, 2:50 PMkarelpeeters
11/02/2018, 3:53 PM