FIR2IR: use ELVIS origin only on wrapping blocks #KT-60250 Fixed

This commit is contained in:
Mikhail Glukhikh
2023-08-18 18:06:54 +02:00
committed by Space Team
parent b06188180e
commit 2ff075c961
15 changed files with 39 additions and 38 deletions
@@ -1194,7 +1194,8 @@ class Fir2IrVisitor(
branches: List<IrBranch>,
resultType: IrType
): IrExpression {
val irWhen = IrWhenImpl(startOffset, endOffset, resultType, origin, branches)
// Note: ELVIS origin is set only on wrapping block
val irWhen = IrWhenImpl(startOffset, endOffset, resultType, origin.takeIf { it != IrStatementOrigin.ELVIS }, branches)
return if (subjectVariable == null) {
irWhen
} else {