yeah, that would feel consistent to me at least. w...
# reflect
d
yeah, that would feel consistent to me at least. what I find confusing, and as misleading as authorizing
T<R>::class
, concretely:
Copy code
fun main(args: Array<String>) {
    val list = listOf<Int>(1, 2)
    println("is List<Int>? ${isInstance<List<Int>>(list)}”)  // -> true, cool
    println("is List<String>? ${isInstance<List<String>>(list)}”)  // -> true, not cool
    println(“direct is List<String>? ${list is List<String>}”)  // doesn’t compile, while equivalent to the above
}

inline fun<reified T> isInstance(obj: Any) =
    obj is T