diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrVisitor.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrVisitor.kt index 15d20ed6aeb..d83aac6e943 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrVisitor.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrVisitor.kt @@ -1094,9 +1094,32 @@ class Fir2IrVisitor( } } + private fun FirBlock.mapToIrStatements(): List { + val irRawStatements = statements.map { it.toIrStatement() } + val result = mutableListOf() + var missNext = false + for ((index, irRawStatement) in irRawStatements.withIndex()) { + if (missNext) { + missNext = false + continue + } else if (irRawStatement is IrVariable && irRawStatement.origin == IrDeclarationOrigin.FOR_LOOP_ITERATOR) { + missNext = true + val irNextStatement = irRawStatements[index + 1]!! + result += IrBlockImpl( + irRawStatement.startOffset, irNextStatement.endOffset, + (irNextStatement as IrExpression).type, IrStatementOrigin.FOR_LOOP, + listOf(irRawStatement, irNextStatement) + ) + } else { + result += irRawStatement + } + } + return result + } + private fun FirBlock.convertToIrBlockBody(): IrBlockBody { return convertWithOffsets { startOffset, endOffset -> - val irStatements = statements.map { it.toIrStatement() } + val irStatements = mapToIrStatements() IrBlockBodyImpl( startOffset, endOffset, if (irStatements.isNotEmpty()) { @@ -1121,7 +1144,7 @@ class Fir2IrVisitor( return convertWithOffsets { startOffset, endOffset -> IrBlockImpl( startOffset, endOffset, type, origin, - statements.mapNotNull { it.toIrStatement() } + mapToIrStatements().filterNotNull() ) } } diff --git a/compiler/testData/codegen/box/controlStructures/forInCharSequence.kt b/compiler/testData/codegen/box/controlStructures/forInCharSequence.kt index d912cb0c08b..b812e816bd5 100644 --- a/compiler/testData/codegen/box/controlStructures/forInCharSequence.kt +++ b/compiler/testData/codegen/box/controlStructures/forInCharSequence.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/controlStructures/forNullableCharInString.kt b/compiler/testData/codegen/box/controlStructures/forNullableCharInString.kt index a7890286f47..fd43765c6cc 100644 --- a/compiler/testData/codegen/box/controlStructures/forNullableCharInString.kt +++ b/compiler/testData/codegen/box/controlStructures/forNullableCharInString.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/ranges/forInReversed/forInReversedEmptyRange.kt b/compiler/testData/codegen/box/ranges/forInReversed/forInReversedEmptyRange.kt index 57b2304ee60..9b4c6037406 100644 --- a/compiler/testData/codegen/box/ranges/forInReversed/forInReversedEmptyRange.kt +++ b/compiler/testData/codegen/box/ranges/forInReversed/forInReversedEmptyRange.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // WITH_RUNTIME import kotlin.test.* diff --git a/compiler/testData/codegen/box/ranges/forInReversed/forInReversedEmptyRangeLiteral.kt b/compiler/testData/codegen/box/ranges/forInReversed/forInReversedEmptyRangeLiteral.kt index 6e1ed562c92..683b9365d58 100644 --- a/compiler/testData/codegen/box/ranges/forInReversed/forInReversedEmptyRangeLiteral.kt +++ b/compiler/testData/codegen/box/ranges/forInReversed/forInReversedEmptyRangeLiteral.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // WITH_RUNTIME fun box(): String { diff --git a/compiler/testData/codegen/box/ranges/forInReversed/forInReversedEmptyRangeLiteralWithNonConstBounds.kt b/compiler/testData/codegen/box/ranges/forInReversed/forInReversedEmptyRangeLiteralWithNonConstBounds.kt index 54a43ba8ef1..32d61af04a3 100644 --- a/compiler/testData/codegen/box/ranges/forInReversed/forInReversedEmptyRangeLiteralWithNonConstBounds.kt +++ b/compiler/testData/codegen/box/ranges/forInReversed/forInReversedEmptyRangeLiteralWithNonConstBounds.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // WITH_RUNTIME import kotlin.test.* diff --git a/compiler/testData/codegen/box/ranges/forInStringVarUpdatedInLoopBody.kt b/compiler/testData/codegen/box/ranges/forInStringVarUpdatedInLoopBody.kt index 0a2ce6b76c9..fc27317bf31 100644 --- a/compiler/testData/codegen/box/ranges/forInStringVarUpdatedInLoopBody.kt +++ b/compiler/testData/codegen/box/ranges/forInStringVarUpdatedInLoopBody.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/ranges/forInUntil/forInUntilLesserInt.kt b/compiler/testData/codegen/box/ranges/forInUntil/forInUntilLesserInt.kt index 45a6ccfaed2..549b8d6fa9a 100644 --- a/compiler/testData/codegen/box/ranges/forInUntil/forInUntilLesserInt.kt +++ b/compiler/testData/codegen/box/ranges/forInUntil/forInUntilLesserInt.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // WITH_RUNTIME import kotlin.test.assertEquals diff --git a/compiler/testData/codegen/box/strings/forInString.kt b/compiler/testData/codegen/box/strings/forInString.kt index 2a6c5582e83..48316a9fcd7 100644 --- a/compiler/testData/codegen/box/strings/forInString.kt +++ b/compiler/testData/codegen/box/strings/forInString.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // WITH_RUNTIME diff --git a/compiler/testData/ir/irText/expressions/breakContinueInLoopHeader.fir.txt b/compiler/testData/ir/irText/expressions/breakContinueInLoopHeader.fir.txt index ae02a836b6f..afd6f33ecc4 100644 --- a/compiler/testData/ir/irText/expressions/breakContinueInLoopHeader.fir.txt +++ b/compiler/testData/ir/irText/expressions/breakContinueInLoopHeader.fir.txt @@ -47,56 +47,58 @@ FILE fqName: fileName:/breakContinueInLoopHeader.kt WHILE label=L origin=WHILE_LOOP condition: CONST Boolean type=kotlin.Boolean value=true body: BLOCK type=kotlin.Unit origin=WHILE_LOOP - VAR FOR_LOOP_ITERATOR name:tmp_2 type:kotlin.collections.Iterator [val] - CALL 'public abstract fun iterator (): kotlin.collections.Iterator [operator] declared in kotlin.collections.List' type=kotlin.collections.Iterator origin=FOR_LOOP_ITERATOR - $this: BLOCK type=kotlin.collections.List origin=ELVIS - VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:kotlin.collections.List? [val] - GET_VAR 'ss: kotlin.collections.List? declared in .test3' type=kotlin.collections.List? origin=null - WHEN type=kotlin.collections.List origin=ELVIS - BRANCH - if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp_3: kotlin.collections.List? [val] declared in .test3' type=kotlin.collections.List? origin=null - arg1: CONST Null type=kotlin.Nothing? value=null - then: CONTINUE label=L loop.label=L - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: TYPE_OP type=kotlin.collections.List origin=IMPLICIT_CAST typeOperand=kotlin.collections.List - GET_VAR 'val tmp_3: kotlin.collections.List? [val] declared in .test3' type=kotlin.collections.List? origin=null - WHILE label=L2 origin=FOR_LOOP_INNER_WHILE - condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT - $this: GET_VAR 'val tmp_2: kotlin.collections.Iterator [val] declared in .test3' type=kotlin.collections.Iterator origin=null - body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE - VAR FOR_LOOP_VARIABLE name:s type:kotlin.String [val] - CALL 'public abstract fun next (): T of kotlin.collections.Iterator [operator] declared in kotlin.collections.Iterator' type=kotlin.String origin=FOR_LOOP_NEXT - $this: GET_VAR 'val tmp_2: kotlin.collections.Iterator [val] declared in .test3' type=kotlin.collections.Iterator origin=null + BLOCK type=kotlin.Unit origin=FOR_LOOP + VAR FOR_LOOP_ITERATOR name:tmp_2 type:kotlin.collections.Iterator [val] + CALL 'public abstract fun iterator (): kotlin.collections.Iterator [operator] declared in kotlin.collections.List' type=kotlin.collections.Iterator origin=FOR_LOOP_ITERATOR + $this: BLOCK type=kotlin.collections.List origin=ELVIS + VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:kotlin.collections.List? [val] + GET_VAR 'ss: kotlin.collections.List? declared in .test3' type=kotlin.collections.List? origin=null + WHEN type=kotlin.collections.List origin=ELVIS + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'val tmp_3: kotlin.collections.List? [val] declared in .test3' type=kotlin.collections.List? origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: CONTINUE label=L loop.label=L + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: TYPE_OP type=kotlin.collections.List origin=IMPLICIT_CAST typeOperand=kotlin.collections.List + GET_VAR 'val tmp_3: kotlin.collections.List? [val] declared in .test3' type=kotlin.collections.List? origin=null + WHILE label=L2 origin=FOR_LOOP_INNER_WHILE + condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT + $this: GET_VAR 'val tmp_2: kotlin.collections.Iterator [val] declared in .test3' type=kotlin.collections.Iterator origin=null + body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE + VAR FOR_LOOP_VARIABLE name:s type:kotlin.String [val] + CALL 'public abstract fun next (): T of kotlin.collections.Iterator [operator] declared in kotlin.collections.Iterator' type=kotlin.String origin=FOR_LOOP_NEXT + $this: GET_VAR 'val tmp_2: kotlin.collections.Iterator [val] declared in .test3' type=kotlin.collections.Iterator origin=null FUN name:test4 visibility:public modality:FINAL <> (ss:kotlin.collections.List?) returnType:kotlin.Unit VALUE_PARAMETER name:ss index:0 type:kotlin.collections.List? BLOCK_BODY WHILE label=L origin=WHILE_LOOP condition: CONST Boolean type=kotlin.Boolean value=true body: BLOCK type=kotlin.Unit origin=WHILE_LOOP - VAR FOR_LOOP_ITERATOR name:tmp_4 type:kotlin.collections.Iterator [val] - CALL 'public abstract fun iterator (): kotlin.collections.Iterator [operator] declared in kotlin.collections.List' type=kotlin.collections.Iterator origin=FOR_LOOP_ITERATOR - $this: BLOCK type=kotlin.collections.List origin=ELVIS - VAR IR_TEMPORARY_VARIABLE name:tmp_5 type:kotlin.collections.List? [val] - GET_VAR 'ss: kotlin.collections.List? declared in .test4' type=kotlin.collections.List? origin=null - WHEN type=kotlin.collections.List origin=ELVIS - BRANCH - if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp_5: kotlin.collections.List? [val] declared in .test4' type=kotlin.collections.List? origin=null - arg1: CONST Null type=kotlin.Nothing? value=null - then: BREAK label=L loop.label=L - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: TYPE_OP type=kotlin.collections.List origin=IMPLICIT_CAST typeOperand=kotlin.collections.List - GET_VAR 'val tmp_5: kotlin.collections.List? [val] declared in .test4' type=kotlin.collections.List? origin=null - WHILE label=L2 origin=FOR_LOOP_INNER_WHILE - condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT - $this: GET_VAR 'val tmp_4: kotlin.collections.Iterator [val] declared in .test4' type=kotlin.collections.Iterator origin=null - body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE - VAR FOR_LOOP_VARIABLE name:s type:kotlin.String [val] - CALL 'public abstract fun next (): T of kotlin.collections.Iterator [operator] declared in kotlin.collections.Iterator' type=kotlin.String origin=FOR_LOOP_NEXT - $this: GET_VAR 'val tmp_4: kotlin.collections.Iterator [val] declared in .test4' type=kotlin.collections.Iterator origin=null + BLOCK type=kotlin.Unit origin=FOR_LOOP + VAR FOR_LOOP_ITERATOR name:tmp_4 type:kotlin.collections.Iterator [val] + CALL 'public abstract fun iterator (): kotlin.collections.Iterator [operator] declared in kotlin.collections.List' type=kotlin.collections.Iterator origin=FOR_LOOP_ITERATOR + $this: BLOCK type=kotlin.collections.List origin=ELVIS + VAR IR_TEMPORARY_VARIABLE name:tmp_5 type:kotlin.collections.List? [val] + GET_VAR 'ss: kotlin.collections.List? declared in .test4' type=kotlin.collections.List? origin=null + WHEN type=kotlin.collections.List origin=ELVIS + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'val tmp_5: kotlin.collections.List? [val] declared in .test4' type=kotlin.collections.List? origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: BREAK label=L loop.label=L + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: TYPE_OP type=kotlin.collections.List origin=IMPLICIT_CAST typeOperand=kotlin.collections.List + GET_VAR 'val tmp_5: kotlin.collections.List? [val] declared in .test4' type=kotlin.collections.List? origin=null + WHILE label=L2 origin=FOR_LOOP_INNER_WHILE + condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT + $this: GET_VAR 'val tmp_4: kotlin.collections.Iterator [val] declared in .test4' type=kotlin.collections.Iterator origin=null + body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE + VAR FOR_LOOP_VARIABLE name:s type:kotlin.String [val] + CALL 'public abstract fun next (): T of kotlin.collections.Iterator [operator] declared in kotlin.collections.Iterator' type=kotlin.String origin=FOR_LOOP_NEXT + $this: GET_VAR 'val tmp_4: kotlin.collections.Iterator [val] declared in .test4' type=kotlin.collections.Iterator origin=null FUN name:test5 visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY VAR name:i type:kotlin.Int [var] diff --git a/compiler/testData/ir/irText/expressions/breakContinueInWhen.fir.txt b/compiler/testData/ir/irText/expressions/breakContinueInWhen.fir.txt index 3f64cf210c9..7244fced15e 100644 --- a/compiler/testData/ir/irText/expressions/breakContinueInWhen.fir.txt +++ b/compiler/testData/ir/irText/expressions/breakContinueInWhen.fir.txt @@ -12,22 +12,23 @@ FILE fqName: fileName:/breakContinueInWhen.kt GET_VAR 'i: kotlin.Int declared in .testBreakFor.' type=kotlin.Int origin=null VAR name:k type:kotlin.Int [var] CONST Int type=kotlin.Int value=0 - VAR FOR_LOOP_ITERATOR name:tmp_0 type:kotlin.collections.IntIterator [val] - CALL 'public final fun iterator (): kotlin.collections.IntIterator [operator] declared in kotlin.IntArray' type=kotlin.collections.IntIterator origin=null - $this: GET_VAR 'val xs: kotlin.IntArray [val] declared in .testBreakFor' type=kotlin.IntArray origin=null - WHILE label=null origin=FOR_LOOP_INNER_WHILE - condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT - $this: GET_VAR 'val tmp_0: kotlin.collections.IntIterator [val] declared in .testBreakFor' type=kotlin.collections.IntIterator origin=null - body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE - VAR FOR_LOOP_VARIABLE name:x type:kotlin.Int [val] - CALL 'public final fun next (): kotlin.Int [operator] declared in kotlin.collections.IntIterator' type=kotlin.Int origin=FOR_LOOP_NEXT - $this: GET_VAR 'val tmp_0: kotlin.collections.IntIterator [val] declared in .testBreakFor' type=kotlin.collections.IntIterator origin=null - WHEN type=kotlin.Unit origin=WHEN - BRANCH - if: CALL 'public final fun greater (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=GT - arg0: GET_VAR 'var k: kotlin.Int [var] declared in .testBreakFor' type=kotlin.Int origin=null - arg1: CONST Int type=kotlin.Int value=2 - then: BREAK label=null loop.label=null + BLOCK type=kotlin.Unit origin=FOR_LOOP + VAR FOR_LOOP_ITERATOR name:tmp_0 type:kotlin.collections.IntIterator [val] + CALL 'public final fun iterator (): kotlin.collections.IntIterator [operator] declared in kotlin.IntArray' type=kotlin.collections.IntIterator origin=null + $this: GET_VAR 'val xs: kotlin.IntArray [val] declared in .testBreakFor' type=kotlin.IntArray origin=null + WHILE label=null origin=FOR_LOOP_INNER_WHILE + condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT + $this: GET_VAR 'val tmp_0: kotlin.collections.IntIterator [val] declared in .testBreakFor' type=kotlin.collections.IntIterator origin=null + body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE + VAR FOR_LOOP_VARIABLE name:x type:kotlin.Int [val] + CALL 'public final fun next (): kotlin.Int [operator] declared in kotlin.collections.IntIterator' type=kotlin.Int origin=FOR_LOOP_NEXT + $this: GET_VAR 'val tmp_0: kotlin.collections.IntIterator [val] declared in .testBreakFor' type=kotlin.collections.IntIterator origin=null + WHEN type=kotlin.Unit origin=WHEN + BRANCH + if: CALL 'public final fun greater (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=GT + arg0: GET_VAR 'var k: kotlin.Int [var] declared in .testBreakFor' type=kotlin.Int origin=null + arg1: CONST Int type=kotlin.Int value=2 + then: BREAK label=null loop.label=null FUN name:testBreakWhile visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY VAR name:k type:kotlin.Int [var] @@ -69,22 +70,23 @@ FILE fqName: fileName:/breakContinueInWhen.kt GET_VAR 'i: kotlin.Int declared in .testContinueFor.' type=kotlin.Int origin=null VAR name:k type:kotlin.Int [var] CONST Int type=kotlin.Int value=0 - VAR FOR_LOOP_ITERATOR name:tmp_1 type:kotlin.collections.IntIterator [val] - CALL 'public final fun iterator (): kotlin.collections.IntIterator [operator] declared in kotlin.IntArray' type=kotlin.collections.IntIterator origin=null - $this: GET_VAR 'val xs: kotlin.IntArray [val] declared in .testContinueFor' type=kotlin.IntArray origin=null - WHILE label=null origin=FOR_LOOP_INNER_WHILE - condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT - $this: GET_VAR 'val tmp_1: kotlin.collections.IntIterator [val] declared in .testContinueFor' type=kotlin.collections.IntIterator origin=null - body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE - VAR FOR_LOOP_VARIABLE name:x type:kotlin.Int [val] - CALL 'public final fun next (): kotlin.Int [operator] declared in kotlin.collections.IntIterator' type=kotlin.Int origin=FOR_LOOP_NEXT - $this: GET_VAR 'val tmp_1: kotlin.collections.IntIterator [val] declared in .testContinueFor' type=kotlin.collections.IntIterator origin=null - WHEN type=kotlin.Unit origin=WHEN - BRANCH - if: CALL 'public final fun greater (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=GT - arg0: GET_VAR 'var k: kotlin.Int [var] declared in .testContinueFor' type=kotlin.Int origin=null - arg1: CONST Int type=kotlin.Int value=2 - then: CONTINUE label=null loop.label=null + BLOCK type=kotlin.Unit origin=FOR_LOOP + VAR FOR_LOOP_ITERATOR name:tmp_1 type:kotlin.collections.IntIterator [val] + CALL 'public final fun iterator (): kotlin.collections.IntIterator [operator] declared in kotlin.IntArray' type=kotlin.collections.IntIterator origin=null + $this: GET_VAR 'val xs: kotlin.IntArray [val] declared in .testContinueFor' type=kotlin.IntArray origin=null + WHILE label=null origin=FOR_LOOP_INNER_WHILE + condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT + $this: GET_VAR 'val tmp_1: kotlin.collections.IntIterator [val] declared in .testContinueFor' type=kotlin.collections.IntIterator origin=null + body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE + VAR FOR_LOOP_VARIABLE name:x type:kotlin.Int [val] + CALL 'public final fun next (): kotlin.Int [operator] declared in kotlin.collections.IntIterator' type=kotlin.Int origin=FOR_LOOP_NEXT + $this: GET_VAR 'val tmp_1: kotlin.collections.IntIterator [val] declared in .testContinueFor' type=kotlin.collections.IntIterator origin=null + WHEN type=kotlin.Unit origin=WHEN + BRANCH + if: CALL 'public final fun greater (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=GT + arg0: GET_VAR 'var k: kotlin.Int [var] declared in .testContinueFor' type=kotlin.Int origin=null + arg1: CONST Int type=kotlin.Int value=2 + then: CONTINUE label=null loop.label=null FUN name:testContinueWhile visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY VAR name:k type:kotlin.Int [var] diff --git a/compiler/testData/ir/irText/expressions/callableReferences/withVarargViewedAsArray.fir.txt b/compiler/testData/ir/irText/expressions/callableReferences/withVarargViewedAsArray.fir.txt index a3fff390b7f..b8d40cbba89 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/withVarargViewedAsArray.fir.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/withVarargViewedAsArray.fir.txt @@ -4,20 +4,21 @@ FILE fqName: fileName:/withVarargViewedAsArray.kt BLOCK_BODY VAR name:result type:kotlin.Int [var] CONST Int type=kotlin.Int value=0 - VAR FOR_LOOP_ITERATOR name:tmp_0 type:kotlin.collections.IntIterator [val] - CALL 'public final fun iterator (): kotlin.collections.IntIterator [operator] declared in kotlin.IntArray' type=kotlin.collections.IntIterator origin=null - $this: GET_VAR 'args: kotlin.IntArray [vararg] declared in .sum' type=kotlin.IntArray origin=null - WHILE label=null origin=FOR_LOOP_INNER_WHILE - condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT - $this: GET_VAR 'val tmp_0: kotlin.collections.IntIterator [val] declared in .sum' type=kotlin.collections.IntIterator origin=null - body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE - VAR FOR_LOOP_VARIABLE name:arg type:kotlin.Int [val] - CALL 'public final fun next (): kotlin.Int [operator] declared in kotlin.collections.IntIterator' type=kotlin.Int origin=FOR_LOOP_NEXT - $this: GET_VAR 'val tmp_0: kotlin.collections.IntIterator [val] declared in .sum' type=kotlin.collections.IntIterator origin=null - SET_VAR 'var result: kotlin.Int [var] declared in .sum' type=kotlin.Unit origin=null - CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null - $this: GET_VAR 'var result: kotlin.Int [var] declared in .sum' type=kotlin.Int origin=null - other: GET_VAR 'val arg: kotlin.Int [val] declared in .sum' type=kotlin.Int origin=null + BLOCK type=kotlin.Unit origin=FOR_LOOP + VAR FOR_LOOP_ITERATOR name:tmp_0 type:kotlin.collections.IntIterator [val] + CALL 'public final fun iterator (): kotlin.collections.IntIterator [operator] declared in kotlin.IntArray' type=kotlin.collections.IntIterator origin=null + $this: GET_VAR 'args: kotlin.IntArray [vararg] declared in .sum' type=kotlin.IntArray origin=null + WHILE label=null origin=FOR_LOOP_INNER_WHILE + condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT + $this: GET_VAR 'val tmp_0: kotlin.collections.IntIterator [val] declared in .sum' type=kotlin.collections.IntIterator origin=null + body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE + VAR FOR_LOOP_VARIABLE name:arg type:kotlin.Int [val] + CALL 'public final fun next (): kotlin.Int [operator] declared in kotlin.collections.IntIterator' type=kotlin.Int origin=FOR_LOOP_NEXT + $this: GET_VAR 'val tmp_0: kotlin.collections.IntIterator [val] declared in .sum' type=kotlin.collections.IntIterator origin=null + SET_VAR 'var result: kotlin.Int [var] declared in .sum' type=kotlin.Unit origin=null + CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'var result: kotlin.Int [var] declared in .sum' type=kotlin.Int origin=null + other: GET_VAR 'val arg: kotlin.Int [val] declared in .sum' type=kotlin.Int origin=null RETURN type=kotlin.Nothing from='public final fun sum (vararg args: kotlin.Int): kotlin.Int declared in ' GET_VAR 'var result: kotlin.Int [var] declared in .sum' type=kotlin.Int origin=null FUN name:nsum visibility:public modality:FINAL <> (args:kotlin.Array) returnType:kotlin.Int diff --git a/compiler/testData/ir/irText/expressions/for.fir.txt b/compiler/testData/ir/irText/expressions/for.fir.txt index a091c3c19fb..a6630c306ce 100644 --- a/compiler/testData/ir/irText/expressions/for.fir.txt +++ b/compiler/testData/ir/irText/expressions/for.fir.txt @@ -2,65 +2,69 @@ FILE fqName: fileName:/for.kt FUN name:testEmpty visibility:public modality:FINAL <> (ss:kotlin.collections.List) returnType:kotlin.Unit VALUE_PARAMETER name:ss index:0 type:kotlin.collections.List BLOCK_BODY - VAR FOR_LOOP_ITERATOR name:tmp_0 type:kotlin.collections.Iterator [val] - CALL 'public abstract fun iterator (): kotlin.collections.Iterator [operator] declared in kotlin.collections.List' type=kotlin.collections.Iterator origin=FOR_LOOP_ITERATOR - $this: GET_VAR 'ss: kotlin.collections.List declared in .testEmpty' type=kotlin.collections.List origin=null - WHILE label=null origin=FOR_LOOP_INNER_WHILE - condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT - $this: GET_VAR 'val tmp_0: kotlin.collections.Iterator [val] declared in .testEmpty' type=kotlin.collections.Iterator origin=null - body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE - VAR FOR_LOOP_VARIABLE name:s type:kotlin.String [val] - CALL 'public abstract fun next (): T of kotlin.collections.Iterator [operator] declared in kotlin.collections.Iterator' type=kotlin.String origin=FOR_LOOP_NEXT - $this: GET_VAR 'val tmp_0: kotlin.collections.Iterator [val] declared in .testEmpty' type=kotlin.collections.Iterator origin=null + BLOCK type=kotlin.Unit origin=FOR_LOOP + VAR FOR_LOOP_ITERATOR name:tmp_0 type:kotlin.collections.Iterator [val] + CALL 'public abstract fun iterator (): kotlin.collections.Iterator [operator] declared in kotlin.collections.List' type=kotlin.collections.Iterator origin=FOR_LOOP_ITERATOR + $this: GET_VAR 'ss: kotlin.collections.List declared in .testEmpty' type=kotlin.collections.List origin=null + WHILE label=null origin=FOR_LOOP_INNER_WHILE + condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT + $this: GET_VAR 'val tmp_0: kotlin.collections.Iterator [val] declared in .testEmpty' type=kotlin.collections.Iterator origin=null + body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE + VAR FOR_LOOP_VARIABLE name:s type:kotlin.String [val] + CALL 'public abstract fun next (): T of kotlin.collections.Iterator [operator] declared in kotlin.collections.Iterator' type=kotlin.String origin=FOR_LOOP_NEXT + $this: GET_VAR 'val tmp_0: kotlin.collections.Iterator [val] declared in .testEmpty' type=kotlin.collections.Iterator origin=null FUN name:testIterable visibility:public modality:FINAL <> (ss:kotlin.collections.List) returnType:kotlin.Unit VALUE_PARAMETER name:ss index:0 type:kotlin.collections.List BLOCK_BODY - VAR FOR_LOOP_ITERATOR name:tmp_1 type:kotlin.collections.Iterator [val] - CALL 'public abstract fun iterator (): kotlin.collections.Iterator [operator] declared in kotlin.collections.List' type=kotlin.collections.Iterator origin=FOR_LOOP_ITERATOR - $this: GET_VAR 'ss: kotlin.collections.List declared in .testIterable' type=kotlin.collections.List origin=null - WHILE label=null origin=FOR_LOOP_INNER_WHILE - condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT - $this: GET_VAR 'val tmp_1: kotlin.collections.Iterator [val] declared in .testIterable' type=kotlin.collections.Iterator origin=null - body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE - VAR FOR_LOOP_VARIABLE name:s type:kotlin.String [val] - CALL 'public abstract fun next (): T of kotlin.collections.Iterator [operator] declared in kotlin.collections.Iterator' type=kotlin.String origin=FOR_LOOP_NEXT - $this: GET_VAR 'val tmp_1: kotlin.collections.Iterator [val] declared in .testIterable' type=kotlin.collections.Iterator origin=null - CALL 'public final fun println (message: kotlin.Any?): kotlin.Unit [inline] declared in kotlin.io' type=kotlin.Unit origin=null - message: GET_VAR 'val s: kotlin.String [val] declared in .testIterable' type=kotlin.String origin=null + BLOCK type=kotlin.Unit origin=FOR_LOOP + VAR FOR_LOOP_ITERATOR name:tmp_1 type:kotlin.collections.Iterator [val] + CALL 'public abstract fun iterator (): kotlin.collections.Iterator [operator] declared in kotlin.collections.List' type=kotlin.collections.Iterator origin=FOR_LOOP_ITERATOR + $this: GET_VAR 'ss: kotlin.collections.List declared in .testIterable' type=kotlin.collections.List origin=null + WHILE label=null origin=FOR_LOOP_INNER_WHILE + condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT + $this: GET_VAR 'val tmp_1: kotlin.collections.Iterator [val] declared in .testIterable' type=kotlin.collections.Iterator origin=null + body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE + VAR FOR_LOOP_VARIABLE name:s type:kotlin.String [val] + CALL 'public abstract fun next (): T of kotlin.collections.Iterator [operator] declared in kotlin.collections.Iterator' type=kotlin.String origin=FOR_LOOP_NEXT + $this: GET_VAR 'val tmp_1: kotlin.collections.Iterator [val] declared in .testIterable' type=kotlin.collections.Iterator origin=null + CALL 'public final fun println (message: kotlin.Any?): kotlin.Unit [inline] declared in kotlin.io' type=kotlin.Unit origin=null + message: GET_VAR 'val s: kotlin.String [val] declared in .testIterable' type=kotlin.String origin=null FUN name:testDestructuring visibility:public modality:FINAL <> (pp:kotlin.collections.List>) returnType:kotlin.Unit VALUE_PARAMETER name:pp index:0 type:kotlin.collections.List> BLOCK_BODY - VAR FOR_LOOP_ITERATOR name:tmp_2 type:kotlin.collections.Iterator> [val] - CALL 'public abstract fun iterator (): kotlin.collections.Iterator> [operator] declared in kotlin.collections.List' type=kotlin.collections.Iterator> origin=FOR_LOOP_ITERATOR - $this: GET_VAR 'pp: kotlin.collections.List> declared in .testDestructuring' type=kotlin.collections.List> origin=null - WHILE label=null origin=FOR_LOOP_INNER_WHILE - condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT - $this: GET_VAR 'val tmp_2: kotlin.collections.Iterator> [val] declared in .testDestructuring' type=kotlin.collections.Iterator> origin=null - body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE - VAR FOR_LOOP_VARIABLE name: type:kotlin.Pair [val] - CALL 'public abstract fun next (): T of kotlin.collections.Iterator [operator] declared in kotlin.collections.Iterator' type=kotlin.Pair origin=FOR_LOOP_NEXT - $this: GET_VAR 'val tmp_2: kotlin.collections.Iterator> [val] declared in .testDestructuring' type=kotlin.collections.Iterator> origin=null - VAR name:i type:kotlin.Int [val] - CALL 'public final fun component1 (): kotlin.Int [operator] declared in kotlin.Pair' type=kotlin.Int origin=null - $this: GET_VAR 'val : kotlin.Pair [val] declared in .testDestructuring' type=kotlin.Pair origin=null - VAR name:s type:kotlin.String [val] - CALL 'public final fun component2 (): kotlin.String [operator] declared in kotlin.Pair' type=kotlin.String origin=null - $this: GET_VAR 'val : kotlin.Pair [val] declared in .testDestructuring' type=kotlin.Pair origin=null - CALL 'public final fun println (message: kotlin.Int): kotlin.Unit [inline] declared in kotlin.io' type=kotlin.Unit origin=null - message: GET_VAR 'val i: kotlin.Int [val] declared in .testDestructuring' type=kotlin.Int origin=null - CALL 'public final fun println (message: kotlin.Any?): kotlin.Unit [inline] declared in kotlin.io' type=kotlin.Unit origin=null - message: GET_VAR 'val s: kotlin.String [val] declared in .testDestructuring' type=kotlin.String origin=null + BLOCK type=kotlin.Unit origin=FOR_LOOP + VAR FOR_LOOP_ITERATOR name:tmp_2 type:kotlin.collections.Iterator> [val] + CALL 'public abstract fun iterator (): kotlin.collections.Iterator> [operator] declared in kotlin.collections.List' type=kotlin.collections.Iterator> origin=FOR_LOOP_ITERATOR + $this: GET_VAR 'pp: kotlin.collections.List> declared in .testDestructuring' type=kotlin.collections.List> origin=null + WHILE label=null origin=FOR_LOOP_INNER_WHILE + condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT + $this: GET_VAR 'val tmp_2: kotlin.collections.Iterator> [val] declared in .testDestructuring' type=kotlin.collections.Iterator> origin=null + body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE + VAR FOR_LOOP_VARIABLE name: type:kotlin.Pair [val] + CALL 'public abstract fun next (): T of kotlin.collections.Iterator [operator] declared in kotlin.collections.Iterator' type=kotlin.Pair origin=FOR_LOOP_NEXT + $this: GET_VAR 'val tmp_2: kotlin.collections.Iterator> [val] declared in .testDestructuring' type=kotlin.collections.Iterator> origin=null + VAR name:i type:kotlin.Int [val] + CALL 'public final fun component1 (): kotlin.Int [operator] declared in kotlin.Pair' type=kotlin.Int origin=null + $this: GET_VAR 'val : kotlin.Pair [val] declared in .testDestructuring' type=kotlin.Pair origin=null + VAR name:s type:kotlin.String [val] + CALL 'public final fun component2 (): kotlin.String [operator] declared in kotlin.Pair' type=kotlin.String origin=null + $this: GET_VAR 'val : kotlin.Pair [val] declared in .testDestructuring' type=kotlin.Pair origin=null + CALL 'public final fun println (message: kotlin.Int): kotlin.Unit [inline] declared in kotlin.io' type=kotlin.Unit origin=null + message: GET_VAR 'val i: kotlin.Int [val] declared in .testDestructuring' type=kotlin.Int origin=null + CALL 'public final fun println (message: kotlin.Any?): kotlin.Unit [inline] declared in kotlin.io' type=kotlin.Unit origin=null + message: GET_VAR 'val s: kotlin.String [val] declared in .testDestructuring' type=kotlin.String origin=null FUN name:testRange visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY - VAR FOR_LOOP_ITERATOR name:tmp_3 type:kotlin.collections.IntIterator [val] - CALL 'public open fun iterator (): kotlin.collections.IntIterator [operator] declared in kotlin.ranges.IntProgression' type=kotlin.collections.IntIterator origin=null - $this: CALL 'public final fun rangeTo (other: kotlin.Int): kotlin.ranges.IntRange [operator] declared in kotlin.Int' type=kotlin.ranges.IntRange origin=null - $this: CONST Int type=kotlin.Int value=1 - other: CONST Int type=kotlin.Int value=10 - WHILE label=null origin=FOR_LOOP_INNER_WHILE - condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT - $this: GET_VAR 'val tmp_3: kotlin.collections.IntIterator [val] declared in .testRange' type=kotlin.collections.IntIterator origin=null - body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE - VAR FOR_LOOP_VARIABLE name:i type:kotlin.Int [val] - CALL 'public final fun next (): kotlin.Int [operator] declared in kotlin.collections.IntIterator' type=kotlin.Int origin=FOR_LOOP_NEXT - $this: GET_VAR 'val tmp_3: kotlin.collections.IntIterator [val] declared in .testRange' type=kotlin.collections.IntIterator origin=null + BLOCK type=kotlin.Unit origin=FOR_LOOP + VAR FOR_LOOP_ITERATOR name:tmp_3 type:kotlin.collections.IntIterator [val] + CALL 'public open fun iterator (): kotlin.collections.IntIterator [operator] declared in kotlin.ranges.IntProgression' type=kotlin.collections.IntIterator origin=null + $this: CALL 'public final fun rangeTo (other: kotlin.Int): kotlin.ranges.IntRange [operator] declared in kotlin.Int' type=kotlin.ranges.IntRange origin=null + $this: CONST Int type=kotlin.Int value=1 + other: CONST Int type=kotlin.Int value=10 + WHILE label=null origin=FOR_LOOP_INNER_WHILE + condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT + $this: GET_VAR 'val tmp_3: kotlin.collections.IntIterator [val] declared in .testRange' type=kotlin.collections.IntIterator origin=null + body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE + VAR FOR_LOOP_VARIABLE name:i type:kotlin.Int [val] + CALL 'public final fun next (): kotlin.Int [operator] declared in kotlin.collections.IntIterator' type=kotlin.Int origin=FOR_LOOP_NEXT + $this: GET_VAR 'val tmp_3: kotlin.collections.IntIterator [val] declared in .testRange' type=kotlin.collections.IntIterator origin=null diff --git a/compiler/testData/ir/irText/expressions/forWithBreakContinue.fir.txt b/compiler/testData/ir/irText/expressions/forWithBreakContinue.fir.txt index 4ae10d31bdb..8d091ac4fed 100644 --- a/compiler/testData/ir/irText/expressions/forWithBreakContinue.fir.txt +++ b/compiler/testData/ir/irText/expressions/forWithBreakContinue.fir.txt @@ -2,82 +2,88 @@ FILE fqName: fileName:/forWithBreakContinue.kt FUN name:testForBreak1 visibility:public modality:FINAL <> (ss:kotlin.collections.List) returnType:kotlin.Unit VALUE_PARAMETER name:ss index:0 type:kotlin.collections.List BLOCK_BODY - VAR FOR_LOOP_ITERATOR name:tmp_0 type:kotlin.collections.Iterator [val] - CALL 'public abstract fun iterator (): kotlin.collections.Iterator [operator] declared in kotlin.collections.List' type=kotlin.collections.Iterator origin=FOR_LOOP_ITERATOR - $this: GET_VAR 'ss: kotlin.collections.List declared in .testForBreak1' type=kotlin.collections.List origin=null - WHILE label=null origin=FOR_LOOP_INNER_WHILE - condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT - $this: GET_VAR 'val tmp_0: kotlin.collections.Iterator [val] declared in .testForBreak1' type=kotlin.collections.Iterator origin=null - body: BLOCK type=kotlin.Nothing origin=FOR_LOOP_INNER_WHILE - VAR FOR_LOOP_VARIABLE name:s type:kotlin.String [val] - CALL 'public abstract fun next (): T of kotlin.collections.Iterator [operator] declared in kotlin.collections.Iterator' type=kotlin.String origin=FOR_LOOP_NEXT - $this: GET_VAR 'val tmp_0: kotlin.collections.Iterator [val] declared in .testForBreak1' type=kotlin.collections.Iterator origin=null - BREAK label=null loop.label=null + BLOCK type=kotlin.Unit origin=FOR_LOOP + VAR FOR_LOOP_ITERATOR name:tmp_0 type:kotlin.collections.Iterator [val] + CALL 'public abstract fun iterator (): kotlin.collections.Iterator [operator] declared in kotlin.collections.List' type=kotlin.collections.Iterator origin=FOR_LOOP_ITERATOR + $this: GET_VAR 'ss: kotlin.collections.List declared in .testForBreak1' type=kotlin.collections.List origin=null + WHILE label=null origin=FOR_LOOP_INNER_WHILE + condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT + $this: GET_VAR 'val tmp_0: kotlin.collections.Iterator [val] declared in .testForBreak1' type=kotlin.collections.Iterator origin=null + body: BLOCK type=kotlin.Nothing origin=FOR_LOOP_INNER_WHILE + VAR FOR_LOOP_VARIABLE name:s type:kotlin.String [val] + CALL 'public abstract fun next (): T of kotlin.collections.Iterator [operator] declared in kotlin.collections.Iterator' type=kotlin.String origin=FOR_LOOP_NEXT + $this: GET_VAR 'val tmp_0: kotlin.collections.Iterator [val] declared in .testForBreak1' type=kotlin.collections.Iterator origin=null + BREAK label=null loop.label=null FUN name:testForBreak2 visibility:public modality:FINAL <> (ss:kotlin.collections.List) returnType:kotlin.Unit VALUE_PARAMETER name:ss index:0 type:kotlin.collections.List BLOCK_BODY - VAR FOR_LOOP_ITERATOR name:tmp_1 type:kotlin.collections.Iterator [val] - CALL 'public abstract fun iterator (): kotlin.collections.Iterator [operator] declared in kotlin.collections.List' type=kotlin.collections.Iterator origin=FOR_LOOP_ITERATOR - $this: GET_VAR 'ss: kotlin.collections.List declared in .testForBreak2' type=kotlin.collections.List origin=null - WHILE label=OUTER origin=FOR_LOOP_INNER_WHILE - condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT - $this: GET_VAR 'val tmp_1: kotlin.collections.Iterator [val] declared in .testForBreak2' type=kotlin.collections.Iterator origin=null - body: BLOCK type=kotlin.Nothing origin=FOR_LOOP_INNER_WHILE - VAR FOR_LOOP_VARIABLE name:s1 type:kotlin.String [val] - CALL 'public abstract fun next (): T of kotlin.collections.Iterator [operator] declared in kotlin.collections.Iterator' type=kotlin.String origin=FOR_LOOP_NEXT - $this: GET_VAR 'val tmp_1: kotlin.collections.Iterator [val] declared in .testForBreak2' type=kotlin.collections.Iterator origin=null - VAR FOR_LOOP_ITERATOR name:tmp_2 type:kotlin.collections.Iterator [val] - CALL 'public abstract fun iterator (): kotlin.collections.Iterator [operator] declared in kotlin.collections.List' type=kotlin.collections.Iterator origin=FOR_LOOP_ITERATOR - $this: GET_VAR 'ss: kotlin.collections.List declared in .testForBreak2' type=kotlin.collections.List origin=null - WHILE label=INNER origin=FOR_LOOP_INNER_WHILE - condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT - $this: GET_VAR 'val tmp_2: kotlin.collections.Iterator [val] declared in .testForBreak2' type=kotlin.collections.Iterator origin=null - body: BLOCK type=kotlin.Nothing origin=FOR_LOOP_INNER_WHILE - VAR FOR_LOOP_VARIABLE name:s2 type:kotlin.String [val] - CALL 'public abstract fun next (): T of kotlin.collections.Iterator [operator] declared in kotlin.collections.Iterator' type=kotlin.String origin=FOR_LOOP_NEXT + BLOCK type=kotlin.Unit origin=FOR_LOOP + VAR FOR_LOOP_ITERATOR name:tmp_1 type:kotlin.collections.Iterator [val] + CALL 'public abstract fun iterator (): kotlin.collections.Iterator [operator] declared in kotlin.collections.List' type=kotlin.collections.Iterator origin=FOR_LOOP_ITERATOR + $this: GET_VAR 'ss: kotlin.collections.List declared in .testForBreak2' type=kotlin.collections.List origin=null + WHILE label=OUTER origin=FOR_LOOP_INNER_WHILE + condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT + $this: GET_VAR 'val tmp_1: kotlin.collections.Iterator [val] declared in .testForBreak2' type=kotlin.collections.Iterator origin=null + body: BLOCK type=kotlin.Nothing origin=FOR_LOOP_INNER_WHILE + VAR FOR_LOOP_VARIABLE name:s1 type:kotlin.String [val] + CALL 'public abstract fun next (): T of kotlin.collections.Iterator [operator] declared in kotlin.collections.Iterator' type=kotlin.String origin=FOR_LOOP_NEXT + $this: GET_VAR 'val tmp_1: kotlin.collections.Iterator [val] declared in .testForBreak2' type=kotlin.collections.Iterator origin=null + BLOCK type=kotlin.Unit origin=FOR_LOOP + VAR FOR_LOOP_ITERATOR name:tmp_2 type:kotlin.collections.Iterator [val] + CALL 'public abstract fun iterator (): kotlin.collections.Iterator [operator] declared in kotlin.collections.List' type=kotlin.collections.Iterator origin=FOR_LOOP_ITERATOR + $this: GET_VAR 'ss: kotlin.collections.List declared in .testForBreak2' type=kotlin.collections.List origin=null + WHILE label=INNER origin=FOR_LOOP_INNER_WHILE + condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT $this: GET_VAR 'val tmp_2: kotlin.collections.Iterator [val] declared in .testForBreak2' type=kotlin.collections.Iterator origin=null - BREAK label=OUTER loop.label=OUTER - BREAK label=INNER loop.label=INNER - BREAK label=INNER loop.label=INNER - BREAK label=OUTER loop.label=OUTER + body: BLOCK type=kotlin.Nothing origin=FOR_LOOP_INNER_WHILE + VAR FOR_LOOP_VARIABLE name:s2 type:kotlin.String [val] + CALL 'public abstract fun next (): T of kotlin.collections.Iterator [operator] declared in kotlin.collections.Iterator' type=kotlin.String origin=FOR_LOOP_NEXT + $this: GET_VAR 'val tmp_2: kotlin.collections.Iterator [val] declared in .testForBreak2' type=kotlin.collections.Iterator origin=null + BREAK label=OUTER loop.label=OUTER + BREAK label=INNER loop.label=INNER + BREAK label=INNER loop.label=INNER + BREAK label=OUTER loop.label=OUTER FUN name:testForContinue1 visibility:public modality:FINAL <> (ss:kotlin.collections.List) returnType:kotlin.Unit VALUE_PARAMETER name:ss index:0 type:kotlin.collections.List BLOCK_BODY - VAR FOR_LOOP_ITERATOR name:tmp_3 type:kotlin.collections.Iterator [val] - CALL 'public abstract fun iterator (): kotlin.collections.Iterator [operator] declared in kotlin.collections.List' type=kotlin.collections.Iterator origin=FOR_LOOP_ITERATOR - $this: GET_VAR 'ss: kotlin.collections.List declared in .testForContinue1' type=kotlin.collections.List origin=null - WHILE label=null origin=FOR_LOOP_INNER_WHILE - condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT - $this: GET_VAR 'val tmp_3: kotlin.collections.Iterator [val] declared in .testForContinue1' type=kotlin.collections.Iterator origin=null - body: BLOCK type=kotlin.Nothing origin=FOR_LOOP_INNER_WHILE - VAR FOR_LOOP_VARIABLE name:s type:kotlin.String [val] - CALL 'public abstract fun next (): T of kotlin.collections.Iterator [operator] declared in kotlin.collections.Iterator' type=kotlin.String origin=FOR_LOOP_NEXT - $this: GET_VAR 'val tmp_3: kotlin.collections.Iterator [val] declared in .testForContinue1' type=kotlin.collections.Iterator origin=null - CONTINUE label=null loop.label=null + BLOCK type=kotlin.Unit origin=FOR_LOOP + VAR FOR_LOOP_ITERATOR name:tmp_3 type:kotlin.collections.Iterator [val] + CALL 'public abstract fun iterator (): kotlin.collections.Iterator [operator] declared in kotlin.collections.List' type=kotlin.collections.Iterator origin=FOR_LOOP_ITERATOR + $this: GET_VAR 'ss: kotlin.collections.List declared in .testForContinue1' type=kotlin.collections.List origin=null + WHILE label=null origin=FOR_LOOP_INNER_WHILE + condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT + $this: GET_VAR 'val tmp_3: kotlin.collections.Iterator [val] declared in .testForContinue1' type=kotlin.collections.Iterator origin=null + body: BLOCK type=kotlin.Nothing origin=FOR_LOOP_INNER_WHILE + VAR FOR_LOOP_VARIABLE name:s type:kotlin.String [val] + CALL 'public abstract fun next (): T of kotlin.collections.Iterator [operator] declared in kotlin.collections.Iterator' type=kotlin.String origin=FOR_LOOP_NEXT + $this: GET_VAR 'val tmp_3: kotlin.collections.Iterator [val] declared in .testForContinue1' type=kotlin.collections.Iterator origin=null + CONTINUE label=null loop.label=null FUN name:testForContinue2 visibility:public modality:FINAL <> (ss:kotlin.collections.List) returnType:kotlin.Unit VALUE_PARAMETER name:ss index:0 type:kotlin.collections.List BLOCK_BODY - VAR FOR_LOOP_ITERATOR name:tmp_4 type:kotlin.collections.Iterator [val] - CALL 'public abstract fun iterator (): kotlin.collections.Iterator [operator] declared in kotlin.collections.List' type=kotlin.collections.Iterator origin=FOR_LOOP_ITERATOR - $this: GET_VAR 'ss: kotlin.collections.List declared in .testForContinue2' type=kotlin.collections.List origin=null - WHILE label=OUTER origin=FOR_LOOP_INNER_WHILE - condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT - $this: GET_VAR 'val tmp_4: kotlin.collections.Iterator [val] declared in .testForContinue2' type=kotlin.collections.Iterator origin=null - body: BLOCK type=kotlin.Nothing origin=FOR_LOOP_INNER_WHILE - VAR FOR_LOOP_VARIABLE name:s1 type:kotlin.String [val] - CALL 'public abstract fun next (): T of kotlin.collections.Iterator [operator] declared in kotlin.collections.Iterator' type=kotlin.String origin=FOR_LOOP_NEXT - $this: GET_VAR 'val tmp_4: kotlin.collections.Iterator [val] declared in .testForContinue2' type=kotlin.collections.Iterator origin=null - VAR FOR_LOOP_ITERATOR name:tmp_5 type:kotlin.collections.Iterator [val] - CALL 'public abstract fun iterator (): kotlin.collections.Iterator [operator] declared in kotlin.collections.List' type=kotlin.collections.Iterator origin=FOR_LOOP_ITERATOR - $this: GET_VAR 'ss: kotlin.collections.List declared in .testForContinue2' type=kotlin.collections.List origin=null - WHILE label=INNER origin=FOR_LOOP_INNER_WHILE - condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT - $this: GET_VAR 'val tmp_5: kotlin.collections.Iterator [val] declared in .testForContinue2' type=kotlin.collections.Iterator origin=null - body: BLOCK type=kotlin.Nothing origin=FOR_LOOP_INNER_WHILE - VAR FOR_LOOP_VARIABLE name:s2 type:kotlin.String [val] - CALL 'public abstract fun next (): T of kotlin.collections.Iterator [operator] declared in kotlin.collections.Iterator' type=kotlin.String origin=FOR_LOOP_NEXT + BLOCK type=kotlin.Unit origin=FOR_LOOP + VAR FOR_LOOP_ITERATOR name:tmp_4 type:kotlin.collections.Iterator [val] + CALL 'public abstract fun iterator (): kotlin.collections.Iterator [operator] declared in kotlin.collections.List' type=kotlin.collections.Iterator origin=FOR_LOOP_ITERATOR + $this: GET_VAR 'ss: kotlin.collections.List declared in .testForContinue2' type=kotlin.collections.List origin=null + WHILE label=OUTER origin=FOR_LOOP_INNER_WHILE + condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT + $this: GET_VAR 'val tmp_4: kotlin.collections.Iterator [val] declared in .testForContinue2' type=kotlin.collections.Iterator origin=null + body: BLOCK type=kotlin.Nothing origin=FOR_LOOP_INNER_WHILE + VAR FOR_LOOP_VARIABLE name:s1 type:kotlin.String [val] + CALL 'public abstract fun next (): T of kotlin.collections.Iterator [operator] declared in kotlin.collections.Iterator' type=kotlin.String origin=FOR_LOOP_NEXT + $this: GET_VAR 'val tmp_4: kotlin.collections.Iterator [val] declared in .testForContinue2' type=kotlin.collections.Iterator origin=null + BLOCK type=kotlin.Unit origin=FOR_LOOP + VAR FOR_LOOP_ITERATOR name:tmp_5 type:kotlin.collections.Iterator [val] + CALL 'public abstract fun iterator (): kotlin.collections.Iterator [operator] declared in kotlin.collections.List' type=kotlin.collections.Iterator origin=FOR_LOOP_ITERATOR + $this: GET_VAR 'ss: kotlin.collections.List declared in .testForContinue2' type=kotlin.collections.List origin=null + WHILE label=INNER origin=FOR_LOOP_INNER_WHILE + condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT $this: GET_VAR 'val tmp_5: kotlin.collections.Iterator [val] declared in .testForContinue2' type=kotlin.collections.Iterator origin=null - CONTINUE label=OUTER loop.label=OUTER - CONTINUE label=INNER loop.label=INNER - CONTINUE label=INNER loop.label=INNER - CONTINUE label=OUTER loop.label=OUTER + body: BLOCK type=kotlin.Nothing origin=FOR_LOOP_INNER_WHILE + VAR FOR_LOOP_VARIABLE name:s2 type:kotlin.String [val] + CALL 'public abstract fun next (): T of kotlin.collections.Iterator [operator] declared in kotlin.collections.Iterator' type=kotlin.String origin=FOR_LOOP_NEXT + $this: GET_VAR 'val tmp_5: kotlin.collections.Iterator [val] declared in .testForContinue2' type=kotlin.collections.Iterator origin=null + CONTINUE label=OUTER loop.label=OUTER + CONTINUE label=INNER loop.label=INNER + CONTINUE label=INNER loop.label=INNER + CONTINUE label=OUTER loop.label=OUTER diff --git a/compiler/testData/ir/irText/expressions/forWithImplicitReceivers.fir.txt b/compiler/testData/ir/irText/expressions/forWithImplicitReceivers.fir.txt index 972850c5c84..05c13e78238 100644 --- a/compiler/testData/ir/irText/expressions/forWithImplicitReceivers.fir.txt +++ b/compiler/testData/ir/irText/expressions/forWithImplicitReceivers.fir.txt @@ -105,15 +105,16 @@ FILE fqName: fileName:/forWithImplicitReceivers.kt FUN name:test visibility:public modality:FINAL <> ($receiver:.IReceiver) returnType:kotlin.Unit $receiver: VALUE_PARAMETER name: type:.IReceiver BLOCK_BODY - VAR FOR_LOOP_ITERATOR name:tmp_1 type:.IntCell [val] - CALL 'public open fun iterator (): .IntCell [operator] declared in .IReceiver' type=.IntCell origin=null - $this: GET_VAR ': .IReceiver declared in .test' type=.IReceiver origin=null - WHILE label=null origin=FOR_LOOP_INNER_WHILE - condition: CALL 'public open fun hasNext (): kotlin.Boolean [operator] declared in .IReceiver' type=kotlin.Boolean origin=null - $this: GET_VAR ': .IReceiver declared in .test' type=.IReceiver origin=null - body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE - VAR name:i type:kotlin.Int [val] - CALL 'public open fun next (): kotlin.Int [operator] declared in .IReceiver' type=kotlin.Int origin=null - $this: GET_VAR ': .IReceiver declared in .test' type=.IReceiver origin=null - CALL 'public final fun println (message: kotlin.Int): kotlin.Unit [inline] declared in kotlin.io' type=kotlin.Unit origin=null - message: GET_VAR 'val i: kotlin.Int [val] declared in .test' type=kotlin.Int origin=null + BLOCK type=kotlin.Unit origin=FOR_LOOP + VAR FOR_LOOP_ITERATOR name:tmp_1 type:.IntCell [val] + CALL 'public open fun iterator (): .IntCell [operator] declared in .IReceiver' type=.IntCell origin=null + $this: GET_VAR ': .IReceiver declared in .test' type=.IReceiver origin=null + WHILE label=null origin=FOR_LOOP_INNER_WHILE + condition: CALL 'public open fun hasNext (): kotlin.Boolean [operator] declared in .IReceiver' type=kotlin.Boolean origin=null + $this: GET_VAR ': .IReceiver declared in .test' type=.IReceiver origin=null + body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE + VAR name:i type:kotlin.Int [val] + CALL 'public open fun next (): kotlin.Int [operator] declared in .IReceiver' type=kotlin.Int origin=null + $this: GET_VAR ': .IReceiver declared in .test' type=.IReceiver origin=null + CALL 'public final fun println (message: kotlin.Int): kotlin.Unit [inline] declared in kotlin.io' type=kotlin.Unit origin=null + message: GET_VAR 'val i: kotlin.Int [val] declared in .test' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInForLoop.fir.txt b/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInForLoop.fir.txt index a04beaea2a4..a659b43cd10 100644 --- a/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInForLoop.fir.txt +++ b/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInForLoop.fir.txt @@ -4,34 +4,36 @@ FILE fqName: fileName:/enhancedNullabilityInForLoop.kt BLOCK_BODY FUN name:testForInListUnused visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY - VAR FOR_LOOP_ITERATOR name:tmp_0 type:kotlin.collections.MutableIterator<.P> [val] - CALL 'public abstract fun iterator (): kotlin.collections.MutableIterator<.P> [operator] declared in kotlin.collections.MutableCollection' type=kotlin.collections.MutableIterator<.P> origin=FOR_LOOP_ITERATOR - $this: CALL 'public open fun listOfNotNull (): kotlin.collections.List<.P>? [operator] declared in .J' type=kotlin.collections.List<.P>? origin=null - WHILE label=null origin=FOR_LOOP_INNER_WHILE - condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT - $this: GET_VAR 'val tmp_0: kotlin.collections.MutableIterator<.P> [val] declared in .testForInListUnused' type=kotlin.collections.MutableIterator<.P> origin=null - body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE - VAR FOR_LOOP_VARIABLE name:x type:.P [val] - CALL 'public abstract fun next (): T of kotlin.collections.MutableIterator [operator] declared in kotlin.collections.Iterator' type=.P origin=FOR_LOOP_NEXT - $this: GET_VAR 'val tmp_0: kotlin.collections.MutableIterator<.P> [val] declared in .testForInListUnused' type=kotlin.collections.MutableIterator<.P> origin=null + BLOCK type=kotlin.Unit origin=FOR_LOOP + VAR FOR_LOOP_ITERATOR name:tmp_0 type:kotlin.collections.MutableIterator<.P> [val] + CALL 'public abstract fun iterator (): kotlin.collections.MutableIterator<.P> [operator] declared in kotlin.collections.MutableCollection' type=kotlin.collections.MutableIterator<.P> origin=FOR_LOOP_ITERATOR + $this: CALL 'public open fun listOfNotNull (): kotlin.collections.List<.P>? [operator] declared in .J' type=kotlin.collections.List<.P>? origin=null + WHILE label=null origin=FOR_LOOP_INNER_WHILE + condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT + $this: GET_VAR 'val tmp_0: kotlin.collections.MutableIterator<.P> [val] declared in .testForInListUnused' type=kotlin.collections.MutableIterator<.P> origin=null + body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE + VAR FOR_LOOP_VARIABLE name:x type:.P [val] + CALL 'public abstract fun next (): T of kotlin.collections.MutableIterator [operator] declared in kotlin.collections.Iterator' type=.P origin=FOR_LOOP_NEXT + $this: GET_VAR 'val tmp_0: kotlin.collections.MutableIterator<.P> [val] declared in .testForInListUnused' type=kotlin.collections.MutableIterator<.P> origin=null FUN name:testForInListDestructured visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY - VAR FOR_LOOP_ITERATOR name:tmp_1 type:kotlin.collections.MutableIterator<.P> [val] - CALL 'public abstract fun iterator (): kotlin.collections.MutableIterator<.P> [operator] declared in kotlin.collections.MutableCollection' type=kotlin.collections.MutableIterator<.P> origin=FOR_LOOP_ITERATOR - $this: CALL 'public open fun listOfNotNull (): kotlin.collections.List<.P>? [operator] declared in .J' type=kotlin.collections.List<.P>? origin=null - WHILE label=null origin=FOR_LOOP_INNER_WHILE - condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT - $this: GET_VAR 'val tmp_1: kotlin.collections.MutableIterator<.P> [val] declared in .testForInListDestructured' type=kotlin.collections.MutableIterator<.P> origin=null - body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE - VAR FOR_LOOP_VARIABLE name: type:.P [val] - CALL 'public abstract fun next (): T of kotlin.collections.MutableIterator [operator] declared in kotlin.collections.Iterator' type=.P origin=FOR_LOOP_NEXT - $this: GET_VAR 'val tmp_1: kotlin.collections.MutableIterator<.P> [val] declared in .testForInListDestructured' type=kotlin.collections.MutableIterator<.P> origin=null - VAR name:x type:kotlin.Int [val] - CALL 'public final fun component1 (): kotlin.Int declared in .P' type=kotlin.Int origin=null - $this: GET_VAR 'val : .P [val] declared in .testForInListDestructured' type=.P origin=null - VAR name:y type:kotlin.Int [val] - CALL 'public final fun component2 (): kotlin.Int declared in .P' type=kotlin.Int origin=null - $this: GET_VAR 'val : .P [val] declared in .testForInListDestructured' type=.P origin=null + BLOCK type=kotlin.Unit origin=FOR_LOOP + VAR FOR_LOOP_ITERATOR name:tmp_1 type:kotlin.collections.MutableIterator<.P> [val] + CALL 'public abstract fun iterator (): kotlin.collections.MutableIterator<.P> [operator] declared in kotlin.collections.MutableCollection' type=kotlin.collections.MutableIterator<.P> origin=FOR_LOOP_ITERATOR + $this: CALL 'public open fun listOfNotNull (): kotlin.collections.List<.P>? [operator] declared in .J' type=kotlin.collections.List<.P>? origin=null + WHILE label=null origin=FOR_LOOP_INNER_WHILE + condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT + $this: GET_VAR 'val tmp_1: kotlin.collections.MutableIterator<.P> [val] declared in .testForInListDestructured' type=kotlin.collections.MutableIterator<.P> origin=null + body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE + VAR FOR_LOOP_VARIABLE name: type:.P [val] + CALL 'public abstract fun next (): T of kotlin.collections.MutableIterator [operator] declared in kotlin.collections.Iterator' type=.P origin=FOR_LOOP_NEXT + $this: GET_VAR 'val tmp_1: kotlin.collections.MutableIterator<.P> [val] declared in .testForInListDestructured' type=kotlin.collections.MutableIterator<.P> origin=null + VAR name:x type:kotlin.Int [val] + CALL 'public final fun component1 (): kotlin.Int declared in .P' type=kotlin.Int origin=null + $this: GET_VAR 'val : .P [val] declared in .testForInListDestructured' type=.P origin=null + VAR name:y type:kotlin.Int [val] + CALL 'public final fun component2 (): kotlin.Int declared in .P' type=kotlin.Int origin=null + $this: GET_VAR 'val : .P [val] declared in .testForInListDestructured' type=.P origin=null FUN name:testDesugaredForInList visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY VAR name:iterator type:kotlin.collections.MutableIterator<.P> [val] @@ -47,51 +49,54 @@ FILE fqName: fileName:/enhancedNullabilityInForLoop.kt FUN name:testForInArrayUnused visibility:public modality:FINAL <> (j:.J) returnType:kotlin.Unit VALUE_PARAMETER name:j index:0 type:.J BLOCK_BODY - VAR FOR_LOOP_ITERATOR name:tmp_2 type:kotlin.collections.Iterator<.P?> [val] - CALL 'public final fun iterator (): kotlin.collections.Iterator<.P?> [operator] declared in kotlin.Array' type=kotlin.collections.Iterator<.P?> origin=null - $this: CALL 'public open fun arrayOfNotNull (): kotlin.Array.P?>? [operator] declared in .J' type=kotlin.Array.P?>? origin=null - $this: GET_VAR 'j: .J declared in .testForInArrayUnused' type=.J origin=null - WHILE label=null origin=FOR_LOOP_INNER_WHILE - condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT - $this: GET_VAR 'val tmp_2: kotlin.collections.Iterator<.P?> [val] declared in .testForInArrayUnused' type=kotlin.collections.Iterator<.P?> origin=null - body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE - VAR FOR_LOOP_VARIABLE name:x type:.P? [val] - CALL 'public abstract fun next (): T of kotlin.collections.Iterator [operator] declared in kotlin.collections.Iterator' type=.P? origin=FOR_LOOP_NEXT - $this: GET_VAR 'val tmp_2: kotlin.collections.Iterator<.P?> [val] declared in .testForInArrayUnused' type=kotlin.collections.Iterator<.P?> origin=null + BLOCK type=kotlin.Unit origin=FOR_LOOP + VAR FOR_LOOP_ITERATOR name:tmp_2 type:kotlin.collections.Iterator<.P?> [val] + CALL 'public final fun iterator (): kotlin.collections.Iterator<.P?> [operator] declared in kotlin.Array' type=kotlin.collections.Iterator<.P?> origin=null + $this: CALL 'public open fun arrayOfNotNull (): kotlin.Array.P?>? [operator] declared in .J' type=kotlin.Array.P?>? origin=null + $this: GET_VAR 'j: .J declared in .testForInArrayUnused' type=.J origin=null + WHILE label=null origin=FOR_LOOP_INNER_WHILE + condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT + $this: GET_VAR 'val tmp_2: kotlin.collections.Iterator<.P?> [val] declared in .testForInArrayUnused' type=kotlin.collections.Iterator<.P?> origin=null + body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE + VAR FOR_LOOP_VARIABLE name:x type:.P? [val] + CALL 'public abstract fun next (): T of kotlin.collections.Iterator [operator] declared in kotlin.collections.Iterator' type=.P? origin=FOR_LOOP_NEXT + $this: GET_VAR 'val tmp_2: kotlin.collections.Iterator<.P?> [val] declared in .testForInArrayUnused' type=kotlin.collections.Iterator<.P?> origin=null FUN name:testForInListUse visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY - VAR FOR_LOOP_ITERATOR name:tmp_3 type:kotlin.collections.MutableIterator<.P> [val] - CALL 'public abstract fun iterator (): kotlin.collections.MutableIterator<.P> [operator] declared in kotlin.collections.MutableCollection' type=kotlin.collections.MutableIterator<.P> origin=FOR_LOOP_ITERATOR - $this: CALL 'public open fun listOfNotNull (): kotlin.collections.List<.P>? [operator] declared in .J' type=kotlin.collections.List<.P>? origin=null - WHILE label=null origin=FOR_LOOP_INNER_WHILE - condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT - $this: GET_VAR 'val tmp_3: kotlin.collections.MutableIterator<.P> [val] declared in .testForInListUse' type=kotlin.collections.MutableIterator<.P> origin=null - body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE - VAR FOR_LOOP_VARIABLE name:x type:.P [val] - CALL 'public abstract fun next (): T of kotlin.collections.MutableIterator [operator] declared in kotlin.collections.Iterator' type=.P origin=FOR_LOOP_NEXT - $this: GET_VAR 'val tmp_3: kotlin.collections.MutableIterator<.P> [val] declared in .testForInListUse' type=kotlin.collections.MutableIterator<.P> origin=null - CALL 'public final fun use (s: .P): kotlin.Unit declared in ' type=kotlin.Unit origin=null - s: GET_VAR 'val x: .P [val] declared in .testForInListUse' type=.P origin=null - CALL 'public open fun use (s: .P): kotlin.Unit [operator] declared in .J' type=kotlin.Unit origin=null - s: GET_VAR 'val x: .P [val] declared in .testForInListUse' type=.P origin=null + BLOCK type=kotlin.Unit origin=FOR_LOOP + VAR FOR_LOOP_ITERATOR name:tmp_3 type:kotlin.collections.MutableIterator<.P> [val] + CALL 'public abstract fun iterator (): kotlin.collections.MutableIterator<.P> [operator] declared in kotlin.collections.MutableCollection' type=kotlin.collections.MutableIterator<.P> origin=FOR_LOOP_ITERATOR + $this: CALL 'public open fun listOfNotNull (): kotlin.collections.List<.P>? [operator] declared in .J' type=kotlin.collections.List<.P>? origin=null + WHILE label=null origin=FOR_LOOP_INNER_WHILE + condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT + $this: GET_VAR 'val tmp_3: kotlin.collections.MutableIterator<.P> [val] declared in .testForInListUse' type=kotlin.collections.MutableIterator<.P> origin=null + body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE + VAR FOR_LOOP_VARIABLE name:x type:.P [val] + CALL 'public abstract fun next (): T of kotlin.collections.MutableIterator [operator] declared in kotlin.collections.Iterator' type=.P origin=FOR_LOOP_NEXT + $this: GET_VAR 'val tmp_3: kotlin.collections.MutableIterator<.P> [val] declared in .testForInListUse' type=kotlin.collections.MutableIterator<.P> origin=null + CALL 'public final fun use (s: .P): kotlin.Unit declared in ' type=kotlin.Unit origin=null + s: GET_VAR 'val x: .P [val] declared in .testForInListUse' type=.P origin=null + CALL 'public open fun use (s: .P): kotlin.Unit [operator] declared in .J' type=kotlin.Unit origin=null + s: GET_VAR 'val x: .P [val] declared in .testForInListUse' type=.P origin=null FUN name:testForInArrayUse visibility:public modality:FINAL <> (j:.J) returnType:kotlin.Unit VALUE_PARAMETER name:j index:0 type:.J BLOCK_BODY - VAR FOR_LOOP_ITERATOR name:tmp_4 type:kotlin.collections.Iterator<.P?> [val] - CALL 'public final fun iterator (): kotlin.collections.Iterator<.P?> [operator] declared in kotlin.Array' type=kotlin.collections.Iterator<.P?> origin=null - $this: CALL 'public open fun arrayOfNotNull (): kotlin.Array.P?>? [operator] declared in .J' type=kotlin.Array.P?>? origin=null - $this: GET_VAR 'j: .J declared in .testForInArrayUse' type=.J origin=null - WHILE label=null origin=FOR_LOOP_INNER_WHILE - condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT - $this: GET_VAR 'val tmp_4: kotlin.collections.Iterator<.P?> [val] declared in .testForInArrayUse' type=kotlin.collections.Iterator<.P?> origin=null - body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE - VAR FOR_LOOP_VARIABLE name:x type:.P? [val] - CALL 'public abstract fun next (): T of kotlin.collections.Iterator [operator] declared in kotlin.collections.Iterator' type=.P? origin=FOR_LOOP_NEXT - $this: GET_VAR 'val tmp_4: kotlin.collections.Iterator<.P?> [val] declared in .testForInArrayUse' type=kotlin.collections.Iterator<.P?> origin=null - CALL 'public final fun use (s: .P): kotlin.Unit declared in ' type=kotlin.Unit origin=null - s: GET_VAR 'val x: .P? [val] declared in .testForInArrayUse' type=.P? origin=null - CALL 'public open fun use (s: .P): kotlin.Unit [operator] declared in .J' type=kotlin.Unit origin=null - s: GET_VAR 'val x: .P? [val] declared in .testForInArrayUse' type=.P? origin=null + BLOCK type=kotlin.Unit origin=FOR_LOOP + VAR FOR_LOOP_ITERATOR name:tmp_4 type:kotlin.collections.Iterator<.P?> [val] + CALL 'public final fun iterator (): kotlin.collections.Iterator<.P?> [operator] declared in kotlin.Array' type=kotlin.collections.Iterator<.P?> origin=null + $this: CALL 'public open fun arrayOfNotNull (): kotlin.Array.P?>? [operator] declared in .J' type=kotlin.Array.P?>? origin=null + $this: GET_VAR 'j: .J declared in .testForInArrayUse' type=.J origin=null + WHILE label=null origin=FOR_LOOP_INNER_WHILE + condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT + $this: GET_VAR 'val tmp_4: kotlin.collections.Iterator<.P?> [val] declared in .testForInArrayUse' type=kotlin.collections.Iterator<.P?> origin=null + body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE + VAR FOR_LOOP_VARIABLE name:x type:.P? [val] + CALL 'public abstract fun next (): T of kotlin.collections.Iterator [operator] declared in kotlin.collections.Iterator' type=.P? origin=FOR_LOOP_NEXT + $this: GET_VAR 'val tmp_4: kotlin.collections.Iterator<.P?> [val] declared in .testForInArrayUse' type=kotlin.collections.Iterator<.P?> origin=null + CALL 'public final fun use (s: .P): kotlin.Unit declared in ' type=kotlin.Unit origin=null + s: GET_VAR 'val x: .P? [val] declared in .testForInArrayUse' type=.P? origin=null + CALL 'public open fun use (s: .P): kotlin.Unit [operator] declared in .J' type=kotlin.Unit origin=null + s: GET_VAR 'val x: .P? [val] declared in .testForInArrayUse' type=.P? origin=null CLASS INTERFACE name:K modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.K FUN name:arrayOfNotNull visibility:public modality:ABSTRACT <> ($this:.K) returnType:kotlin.Array<.P>