KT-11030 When constructor of object expression calls super constructor, place this call at object creation instead of object's constructor. This allows to capture outer this reference properly in certain cases. JVM backend uses the same approach
This commit is contained in:
+5
-1
@@ -5,6 +5,10 @@ open class A(val b : B) {
|
||||
}
|
||||
|
||||
fun box() : String {
|
||||
A(B()).a()
|
||||
val b = B()
|
||||
val a = A(b).a()
|
||||
|
||||
if (a.b !== b) return "failed"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user