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,20 @@
|
||||
open class A {
|
||||
open val a = "OK"
|
||||
}
|
||||
|
||||
class B : A() {
|
||||
override val a = "FAIL"
|
||||
fun foo() = "CRUSH"
|
||||
}
|
||||
|
||||
class C {
|
||||
fun A?.complex(): String {
|
||||
if (this is B) return foo()
|
||||
else if (this != null) return a
|
||||
else return "???"
|
||||
}
|
||||
|
||||
fun bar() = A().complex()
|
||||
}
|
||||
|
||||
fun box() = C().bar()
|
||||
Reference in New Issue
Block a user