[IR BE] Remap dispatch receiver for inner ctor too

- do not forget to add into mapping dispatch receiver
 - fix KT-40686 (at least part of it)
 - add test
This commit is contained in:
Roman Artemev
2020-11-09 17:06:42 +03:00
parent 1ced0138ff
commit 94acfa50bd
10 changed files with 74 additions and 2 deletions
@@ -0,0 +1,24 @@
// KT-40686
class Outer(val o: String, val oo: String) {
inner class InnerArg(val i: String) {
val result: String get() = o + i
}
inner class InnerParam(val i: InnerArg = InnerArg("B")) {
fun foo() = i.result + oo
}
}
fun box(): String {
val o = Outer("A", "C")
val i = o.InnerParam()
val rr = i.foo()
if (rr != "ABC") return "FAIL: $rr"
return "OK"
}