[FIR2IR] Don't set WHILE_LOOP origin for blocks

This commit is contained in:
Mikhail Glukhikh
2020-10-22 13:42:48 +03:00
committed by teamcityserver
parent eb9b5da82b
commit ef6b643b9c
7 changed files with 24 additions and 23 deletions
@@ -873,7 +873,8 @@ class Fir2IrVisitor(
loopMap[whileLoop] = this
label = whileLoop.label?.name
condition = convertToIrExpression(whileLoop.condition)
body = whileLoop.block.convertToIrExpressionOrBlock(origin)
// NB: here we have strange origin logic, made to be compatible with FE 1.0
body = whileLoop.block.convertToIrExpressionOrBlock(origin.takeIf { it != IrStatementOrigin.WHILE_LOOP })
loopMap.remove(whileLoop)
}
}