Introduction of CastedClassReceiver and its handling in codegen #KT-6744 Fixed
ClassReceiver converted to Kotlin Also #KT-7617 Fixed
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
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()
|
||||
Reference in New Issue
Block a user