[IR] Improve stepping/LVT behavior around destructuring

This commit is contained in:
Kristoffer Andersen
2022-03-07 19:39:32 +01:00
committed by Alexander Udalov
parent c3dbb44e5f
commit 7f531d8426
21 changed files with 197 additions and 38 deletions
@@ -16,7 +16,6 @@
package org.jetbrains.kotlin.ir.builders
import org.jetbrains.kotlin.ir.UNDEFINED_OFFSET
import org.jetbrains.kotlin.ir.declarations.IrDeclaration
import org.jetbrains.kotlin.ir.declarations.IrDeclarationOrigin
import org.jetbrains.kotlin.ir.declarations.IrDeclarationParent
@@ -71,12 +70,14 @@ class Scope(val scopeOwnerSymbol: IrSymbol) {
nameHint: String? = null,
isMutable: Boolean = false,
origin: IrDeclarationOrigin = IrDeclarationOrigin.IR_TEMPORARY_VARIABLE,
irType: IrType? = null
irType: IrType? = null,
startOffset: Int = irExpression.startOffset,
endOffset: Int = irExpression.endOffset
): IrVariable {
return createTemporaryVariableDeclaration(
irType ?: irExpression.type,
nameHint, isMutable,
origin, irExpression.startOffset, irExpression.endOffset
origin, startOffset, endOffset
).apply {
initializer = irExpression
}