Files
kotlin/compiler/testData/codegen/box/smartCasts/genericSet.kt
Anton Bannykh 43e3314255 JS IR: Remove inline functions with reified type parameters
Otherwise we cannot handle type casts
2018-06-18 13:15:19 +03:00

14 lines
220 B
Kotlin
Vendored

class Wrapper<T>(var x: T)
inline fun <reified T> change(w: Wrapper<T>, x: Any?) {
if (x is T) {
w.x = x
}
}
fun box(): String {
val w = Wrapper<String>("FAIL")
change(w, "OK")
return w.x
}