Files
kotlin-fork/compiler/testData/codegen/box/smartCasts/kt17725.kt
T
2018-06-09 19:15:38 +03:00

11 lines
183 B
Kotlin
Vendored

// IGNORE_BACKEND: JS_IR
class Bob {
fun Bob.bar() = "OK"
}
fun Any.foo() = when(this) {
is Bob -> bar()
else -> throw AssertionError()
}
fun box(): String = Bob().foo()