https://kotlinlang.org logo
#announcements
Title
# announcements
a

Alowaniak

08/23/2019, 7:01 AM
Do you need the reified though? Can't you get the class from the instance at runtime like
when(defaultValue::class)
or something like that
d

diesieben07

08/23/2019, 7:06 AM
That's not the same. Your version might get a subclass, depending on the actual type of
defaultValue
.
a

Alowaniak

08/23/2019, 7:08 AM
True, but so far he only specifically checks types that don't have a subclass, the others are just in an
else
And even then he could still use
isAssignableFrom
or w/e the methods are