Set proper origin for cascaded if expression

This commit is contained in:
Mikhael Bogdanov
2019-03-12 13:40:51 +01:00
parent 1040665471
commit 1e3277d0e6
3 changed files with 7 additions and 7 deletions
@@ -81,7 +81,7 @@ class BranchingExpressionGenerator(statementGenerator: StatementGenerator) : Sta
}
}
val irWhen = IrWhenImpl(ktIf.startOffsetSkippingComments, ktIf.endOffset, resultType, IrStatementOrigin.WHEN)
val irWhen = IrWhenImpl(ktIf.startOffsetSkippingComments, ktIf.endOffset, resultType, IrStatementOrigin.IF)
irWhen.branches.addAll(irBranches)
+5 -5
View File
@@ -3,7 +3,7 @@
BB 0
CONTENT
1 FUN name:compare visibility:public modality:FINAL <> (x:kotlin.Int, y:kotlin.Int) returnType:kotlin.Int flags:
2 WHEN type=kotlin.Int origin=WHEN
2 WHEN type=kotlin.Int origin=IF
3 GET_VAR 'value-parameter x: Int' type=kotlin.Int origin=null
4 GET_VAR 'value-parameter y: Int' type=kotlin.Int origin=null
OUTGOING -> BB 1, 3
@@ -28,24 +28,24 @@ INCOMING <- BB 0
CONTENT
1 CONST Int type=kotlin.Int value=1
OUTGOING -> BB 6
When exit: WHEN type=kotlin.Int origin=WHEN
When exit: WHEN type=kotlin.Int origin=IF
BB 4
INCOMING <- BB 1
CALL 'less(Int, Int): Boolean' type=kotlin.Boolean origin=LT
CONTENT
1 CONST Int type=kotlin.Int value=-1
OUTGOING -> BB 6
When exit: WHEN type=kotlin.Int origin=WHEN
When exit: WHEN type=kotlin.Int origin=IF
BB 5
INCOMING <- BB 2
CONST Boolean type=kotlin.Boolean value=true
CONTENT
1 CONST Int type=kotlin.Int value=0
OUTGOING -> BB 6
When exit: WHEN type=kotlin.Int origin=WHEN
When exit: WHEN type=kotlin.Int origin=IF
BB 6
INCOMING <- BB 3, 4, 5
When exit: WHEN type=kotlin.Int origin=WHEN
When exit: WHEN type=kotlin.Int origin=IF
CONTENT
1 RETURN type=kotlin.Nothing from='compare(Int, Int): Int'
OUTGOING -> NONE
+1 -1
View File
@@ -3,7 +3,7 @@ FILE fqName:<root> fileName:/ifElseIf.kt
VALUE_PARAMETER name:i index:0 type:kotlin.Int flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='test(Int): Int'
WHEN type=kotlin.Int origin=WHEN
WHEN type=kotlin.Int origin=IF
BRANCH
if: CALL 'greater(Int, Int): Boolean' type=kotlin.Boolean origin=GT
arg0: GET_VAR 'value-parameter i: Int' type=kotlin.Int origin=null