Change your type to indicate it is not-nullable and it should work. You can do this by indicating that T
needs to extend Any
(rather than Any?
).
fun <T : Any> test(t: T) {
t::class
}
Change your type to indicate it is not-nullable and it should work. You can do this by indicating that T
needs to extend Any
(rather than Any?
).
fun <T : Any> test(t: T) {
t::class
}