Ray Rahke
03/09/2024, 5:07 AMhfhbd
03/09/2024, 6:26 AMsevenIsInstanceOf(Int::class)
otherwise you pass the implicit companion object of Int. But your function won’t work anyway, you can’t use a typed KClass
with the is
operator, you have to use type.isInstance(7)
.
Or without a class parameter using the `Type`:
inline fun <reified T> sevenIsInstanceOf(): Boolean {
return 7 is T
}
sevenIsInstanceOf<Int>()