Files
kotlin-fork/compiler/testData/codegen/box/checkcastOptimization/kt19128.kt
T
Dmitry Petrov fda89e9c72 Add test for KT-19128
It looks like the problem was caused by incorrect merging of
StrictBasicValues and was fixed by commit
904c7f9c64.

 #KT-19128 Fixed
2017-07-24 10:15:27 +03:00

26 lines
386 B
Kotlin
Vendored

class A
class B
class C
fun foo(parameters: Any?): Any? {
var payload: Any? = null
if (parameters != null) {
if (parameters is A || parameters is B) {
payload = parameters
} else {
payload = "O"
}
}
if (payload is String) {
payload += "K"
}
return payload
}
fun box(): String =
"${foo(C())}"