Files
kotlin/compiler/testData/codegen/box/smartCasts/genericSet.kt
2016-01-22 16:36:57 +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
}