What is the output?
inline fun <reified T>
checkType(v: Any): Boolean {
return v is T
}
fun main() {
val r = checkType<String>("ok")
println(r)
}
Try it in the online Kotlin Playground →
[spoiler title="Solution"]
Answer:
true
Explanation:
reified preserves type info at runtime in inline functions.
[/spoiler]