[FIR] Support fields as part of graph of class initialization

^KT-49747 Fixed
This commit is contained in:
Dmitriy Novozhilov
2021-11-22 15:41:22 +03:00
committed by teamcityserver
parent 5778cb440f
commit 9c7058c3c5
10 changed files with 343 additions and 2 deletions
@@ -0,0 +1,21 @@
// ISSUE: KT-49747
// DUMP_CFG
class A(val path: String?, val index: Int)
interface Base
class Derived(val index: Int) : Base
fun test(a: A?): Base? {
val path = a?.path ?: return null
takeInt(a.index) // should be ok
return object : Base by Derived(a.index) {
val x: Int = a.index
fun foo() {
takeInt(a.index)
}
}
}
fun takeInt(x: Int) {}