Files
kotlin/compiler/testData/codegen/box/smartCasts/genericSet.kt
2019-11-19 11:00:09 +03:00

15 lines
250 B
Kotlin
Vendored

// IGNORE_BACKEND_FIR: JVM_IR
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
}