[FIR] Fix node ordering for delegating constructor graph
Inject delegated constructor and other in-place initializer sub-graphs after the delegated constructor call node. This ensures property initialization and use is calculated correctly when there are complex calculations for the arguments to the delegated constructor. #KT-59708 Fixed #KT-59832 Fixed
This commit is contained in:
+25
@@ -0,0 +1,25 @@
|
||||
// FIR_IDENTICAL
|
||||
// WITH_STDLIB
|
||||
// DUMP_CFG
|
||||
// ISSUE: KT-53898
|
||||
|
||||
class Test {
|
||||
private var size: Int
|
||||
private val values: List<String>
|
||||
|
||||
init {
|
||||
this.size = 0
|
||||
}
|
||||
|
||||
constructor(map: Map<String, String>) : this(map.values.map { it }) {
|
||||
this.size += this.values.size
|
||||
}
|
||||
|
||||
constructor(set: Set<String>) : this(set.map { it }) {
|
||||
this.size += this.values.size
|
||||
}
|
||||
|
||||
private constructor(list: List<String>) {
|
||||
this.values = list
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user