So obviously I am doing this wrong, but I am not s...
# getting-started
r
So obviously I am doing this wrong, but I am not sure how to get it working.
h
sevenIsInstanceOf(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`:
Copy code
inline fun <reified T> sevenIsInstanceOf(): Boolean {
    return 7 is T
}

sevenIsInstanceOf<Int>()