522eeae062
To convert smart cast expression, now we just convert original expression in standard way and wrap it with TYPE_OP. Before this commit original expression was converted in different way, that led to errors e.g. for this expression casting.
19 lines
319 B
Kotlin
Vendored
19 lines
319 B
Kotlin
Vendored
|
|
open class SuperFoo {
|
|
public fun bar(): String {
|
|
if (this is Foo) {
|
|
superFoo() // Smart cast
|
|
return baz() // Cannot be cast
|
|
}
|
|
return baz()
|
|
}
|
|
|
|
public fun baz() = "OK"
|
|
}
|
|
|
|
class Foo : SuperFoo() {
|
|
public fun superFoo() {}
|
|
}
|
|
|
|
fun box(): String = Foo().bar()
|