KT-11030 Fix referencing wrong field generated for captured variable when this captured variable referenced both from constructor and non-constructor method. Avoid duplicate generation of call to delegated constructor.
This commit is contained in:
+9
@@ -0,0 +1,9 @@
|
||||
class A(val f: () -> Int) {
|
||||
constructor() : this({ 23 })
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val result = A().f()
|
||||
if (result != 23) return "fail: $result"
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user