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:
Alexey Andreev
2016-03-26 14:50:57 +03:00
parent 03dc9c0fa4
commit 7afca74b94
7 changed files with 81 additions and 45 deletions
+5 -1
View File
@@ -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"
}