[FIR2IR] Fix generating body for for-loop
This commit is contained in:
committed by
TeamCityServer
parent
5d78b0a962
commit
d0a148074f
@@ -16,6 +16,7 @@ import org.jetbrains.kotlin.fir.declarations.*
|
|||||||
import org.jetbrains.kotlin.fir.declarations.builder.buildProperty
|
import org.jetbrains.kotlin.fir.declarations.builder.buildProperty
|
||||||
import org.jetbrains.kotlin.fir.declarations.impl.FirDeclarationStatusImpl
|
import org.jetbrains.kotlin.fir.declarations.impl.FirDeclarationStatusImpl
|
||||||
import org.jetbrains.kotlin.fir.expressions.*
|
import org.jetbrains.kotlin.fir.expressions.*
|
||||||
|
import org.jetbrains.kotlin.fir.expressions.builder.buildBlock
|
||||||
import org.jetbrains.kotlin.fir.expressions.impl.FirElseIfTrueCondition
|
import org.jetbrains.kotlin.fir.expressions.impl.FirElseIfTrueCondition
|
||||||
import org.jetbrains.kotlin.fir.expressions.impl.FirStubStatement
|
import org.jetbrains.kotlin.fir.expressions.impl.FirStubStatement
|
||||||
import org.jetbrains.kotlin.fir.expressions.impl.FirUnitExpression
|
import org.jetbrains.kotlin.fir.expressions.impl.FirUnitExpression
|
||||||
@@ -745,14 +746,44 @@ class Fir2IrVisitor(
|
|||||||
|
|
||||||
override fun visitWhileLoop(whileLoop: FirWhileLoop, data: Any?): IrElement {
|
override fun visitWhileLoop(whileLoop: FirWhileLoop, data: Any?): IrElement {
|
||||||
return whileLoop.convertWithOffsets { startOffset, endOffset ->
|
return whileLoop.convertWithOffsets { startOffset, endOffset ->
|
||||||
val origin = if (whileLoop.source?.elementType == KtNodeTypes.FOR) IrStatementOrigin.FOR_LOOP_INNER_WHILE
|
val isForLoop = whileLoop.source?.elementType == KtNodeTypes.FOR
|
||||||
else IrStatementOrigin.WHILE_LOOP
|
val origin = if (isForLoop) IrStatementOrigin.FOR_LOOP_INNER_WHILE else IrStatementOrigin.WHILE_LOOP
|
||||||
|
val firLoopBody = whileLoop.block
|
||||||
IrWhileLoopImpl(startOffset, endOffset, irBuiltIns.unitType, origin).apply {
|
IrWhileLoopImpl(startOffset, endOffset, irBuiltIns.unitType, origin).apply {
|
||||||
loopMap[whileLoop] = this
|
loopMap[whileLoop] = this
|
||||||
label = whileLoop.label?.name
|
label = whileLoop.label?.name
|
||||||
condition = convertToIrExpression(whileLoop.condition)
|
condition = convertToIrExpression(whileLoop.condition)
|
||||||
// NB: here we have strange origin logic, made to be compatible with FE 1.0
|
body = if (isForLoop) {
|
||||||
body = whileLoop.block.convertToIrExpressionOrBlock(origin.takeIf { it != IrStatementOrigin.WHILE_LOOP })
|
/*
|
||||||
|
* for loops in IR should have specific for of their body, because some of lowerings (e.g. `ForLoopLowering`) expects
|
||||||
|
* exactly that shape:
|
||||||
|
*
|
||||||
|
* for (x in list) { ...body...}
|
||||||
|
*
|
||||||
|
* IR (loop body):
|
||||||
|
* IrBlock:
|
||||||
|
* x = <iterator>.next()
|
||||||
|
* IrBlock:
|
||||||
|
* ...body...
|
||||||
|
*/
|
||||||
|
firLoopBody.convertWithOffsets { innerStartOffset, innerEndOffset ->
|
||||||
|
val irInnerBody = IrBlockImpl(innerStartOffset, innerEndOffset, irBuiltIns.unitType, origin)
|
||||||
|
irInnerBody.statements += firLoopBody.statements.first().toIrStatement()
|
||||||
|
?: error("Unexpected shape of body of for loop")
|
||||||
|
if (firLoopBody.statements.size > 1) {
|
||||||
|
val tmpBlock = buildBlock {
|
||||||
|
source = firLoopBody.source
|
||||||
|
for (i in 1 until firLoopBody.statements.size) {
|
||||||
|
statements += firLoopBody.statements[i]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
irInnerBody.statements += tmpBlock.convertToIrExpressionOrBlock()
|
||||||
|
}
|
||||||
|
irInnerBody
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
firLoopBody.convertToIrExpressionOrBlock()
|
||||||
|
}
|
||||||
loopMap.remove(whileLoop)
|
loopMap.remove(whileLoop)
|
||||||
}
|
}
|
||||||
}.also {
|
}.also {
|
||||||
|
|||||||
+6
@@ -15182,6 +15182,12 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
|
|||||||
runTest("compiler/testData/codegen/box/fir/NameHighlighter.kt");
|
runTest("compiler/testData/codegen/box/fir/NameHighlighter.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("noSymbolForIntRangeIterator.kt")
|
||||||
|
public void testNoSymbolForIntRangeIterator() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/fir/noSymbolForIntRangeIterator.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("SuspendExtension.kt")
|
@TestMetadata("SuspendExtension.kt")
|
||||||
public void testSuspendExtension() throws Exception {
|
public void testSuspendExtension() throws Exception {
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
// WITH_RUNTIME
|
// WITH_RUNTIME
|
||||||
// IGNORE_BACKEND_FIR: JVM_IR
|
|
||||||
// TARGET_BACKEND: JVM
|
// TARGET_BACKEND: JVM
|
||||||
|
|
||||||
private const val MOD = 998244353
|
private const val MOD = 998244353
|
||||||
|
|||||||
@@ -0,0 +1,112 @@
|
|||||||
|
FILE fqName:<root> fileName:/noSymbolForIntRangeIterator.kt
|
||||||
|
PROPERTY name:result visibility:public modality:FINAL [var]
|
||||||
|
FIELD PROPERTY_BACKING_FIELD name:result type:kotlin.Int visibility:private [static]
|
||||||
|
EXPRESSION_BODY
|
||||||
|
CONST Int type=kotlin.Int value=0
|
||||||
|
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-result> visibility:public modality:FINAL <> () returnType:kotlin.Int
|
||||||
|
correspondingProperty: PROPERTY name:result visibility:public modality:FINAL [var]
|
||||||
|
BLOCK_BODY
|
||||||
|
RETURN type=kotlin.Nothing from='public final fun <get-result> (): kotlin.Int declared in <root>'
|
||||||
|
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:result type:kotlin.Int visibility:private [static]' type=kotlin.Int origin=null
|
||||||
|
FUN DEFAULT_PROPERTY_ACCESSOR name:<set-result> visibility:public modality:FINAL <> (<set-?>:kotlin.Int) returnType:kotlin.Unit
|
||||||
|
correspondingProperty: PROPERTY name:result visibility:public modality:FINAL [var]
|
||||||
|
VALUE_PARAMETER name:<set-?> index:0 type:kotlin.Int
|
||||||
|
BLOCK_BODY
|
||||||
|
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:result type:kotlin.Int visibility:private [static]' type=kotlin.Unit origin=null
|
||||||
|
value: GET_VAR '<set-?>: kotlin.Int declared in <root>.<set-result>' type=kotlin.Int origin=null
|
||||||
|
FUN name:takeString visibility:public modality:FINAL <> (s:kotlin.String) returnType:kotlin.Unit
|
||||||
|
VALUE_PARAMETER name:s index:0 type:kotlin.String
|
||||||
|
BLOCK_BODY
|
||||||
|
CALL 'public final fun forEach <T> (action: kotlin.Function1<T of kotlin.collections.CollectionsKt.forEach, kotlin.Unit>): kotlin.Unit [inline] declared in kotlin.collections.CollectionsKt' type=kotlin.Unit origin=null
|
||||||
|
<T>: kotlin.String
|
||||||
|
$receiver: CALL 'public final fun split (vararg delimiters: kotlin.String, ignoreCase: kotlin.Boolean, limit: kotlin.Int): kotlin.collections.List<kotlin.String> declared in kotlin.text.StringsKt' type=kotlin.collections.List<kotlin.String> origin=null
|
||||||
|
$receiver: GET_VAR 's: kotlin.String declared in <root>.takeString' type=kotlin.String origin=null
|
||||||
|
delimiters: VARARG type=kotlin.Array<out kotlin.String> varargElementType=kotlin.String
|
||||||
|
CONST String type=kotlin.String value="\n"
|
||||||
|
action: FUN_EXPR type=kotlin.Function1<kotlin.String, kotlin.Unit> origin=LAMBDA
|
||||||
|
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> (it:kotlin.String) returnType:kotlin.Unit
|
||||||
|
VALUE_PARAMETER name:it index:0 type:kotlin.String
|
||||||
|
BLOCK_BODY
|
||||||
|
CALL 'public final fun <set-result> (<set-?>: kotlin.Int): kotlin.Unit declared in <root>' type=kotlin.Unit origin=EQ
|
||||||
|
<set-?>: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||||
|
$this: CALL 'public final fun <get-result> (): kotlin.Int declared in <root>' type=kotlin.Int origin=GET_PROPERTY
|
||||||
|
other: BLOCK type=kotlin.Int origin=ELVIS
|
||||||
|
VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.Int? [val]
|
||||||
|
CALL 'public final fun toIntOrNull (): kotlin.Int? declared in kotlin.text.StringsKt' type=kotlin.Int? origin=null
|
||||||
|
$receiver: GET_VAR 'it: kotlin.String declared in <root>.takeString.<anonymous>' type=kotlin.String origin=null
|
||||||
|
WHEN type=kotlin.Int 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_0: kotlin.Int? [val] declared in <root>.takeString.<anonymous>' type=kotlin.Int? origin=null
|
||||||
|
arg1: CONST Null type=kotlin.Nothing? value=null
|
||||||
|
then: CONST Int type=kotlin.Int value=0
|
||||||
|
BRANCH
|
||||||
|
if: CONST Boolean type=kotlin.Boolean value=true
|
||||||
|
then: GET_VAR 'val tmp_0: kotlin.Int? [val] declared in <root>.takeString.<anonymous>' type=kotlin.Int? origin=null
|
||||||
|
FUN name:test visibility:public modality:FINAL <> () returnType:kotlin.Unit
|
||||||
|
BLOCK_BODY
|
||||||
|
VAR name:x type:kotlin.Int [val]
|
||||||
|
CONST Int type=kotlin.Int value=10
|
||||||
|
VAR name:y type:kotlin.Int [val]
|
||||||
|
CONST Int type=kotlin.Int value=10
|
||||||
|
FUN name:localFunc visibility:local modality:FINAL <> () returnType:kotlin.Unit
|
||||||
|
BLOCK_BODY
|
||||||
|
BLOCK type=kotlin.Unit origin=FOR_LOOP
|
||||||
|
VAR FOR_LOOP_ITERATOR name:tmp_1 type:kotlin.collections.IntIterator [val]
|
||||||
|
CALL 'public open fun iterator (): kotlin.collections.IntIterator [operator] declared in kotlin.ranges.IntProgression' type=kotlin.collections.IntIterator origin=FOR_LOOP_ITERATOR
|
||||||
|
$this: CALL 'public final fun rangeTo (other: kotlin.Int): kotlin.ranges.IntRange [operator] declared in kotlin.Int' type=kotlin.ranges.IntRange origin=RANGE
|
||||||
|
$this: CONST Int type=kotlin.Int value=0
|
||||||
|
other: GET_VAR 'val x: kotlin.Int [val] declared in <root>.test' type=kotlin.Int 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 <root>.test.localFunc' 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_1: kotlin.collections.IntIterator [val] declared in <root>.test.localFunc' type=kotlin.collections.IntIterator origin=null
|
||||||
|
BLOCK type=kotlin.Unit origin=null
|
||||||
|
VAR name:s type:kotlin.String [val]
|
||||||
|
CALL 'public final fun buildString (builderAction: @[ExtensionFunctionType] kotlin.Function1<java.lang.StringBuilder, kotlin.Unit>): kotlin.String [inline] declared in kotlin.text.StringsKt' type=kotlin.String origin=null
|
||||||
|
builderAction: FUN_EXPR type=kotlin.Function1<java.lang.StringBuilder, kotlin.Unit> origin=LAMBDA
|
||||||
|
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> ($receiver:java.lang.StringBuilder) returnType:kotlin.Unit
|
||||||
|
$receiver: VALUE_PARAMETER name:<this> type:java.lang.StringBuilder
|
||||||
|
BLOCK_BODY
|
||||||
|
BLOCK type=kotlin.Unit origin=FOR_LOOP
|
||||||
|
VAR FOR_LOOP_ITERATOR name:tmp_2 type:kotlin.collections.IntIterator [val]
|
||||||
|
CALL 'public open fun iterator (): kotlin.collections.IntIterator [operator] declared in kotlin.ranges.IntProgression' type=kotlin.collections.IntIterator origin=FOR_LOOP_ITERATOR
|
||||||
|
$this: CALL 'public final fun rangeTo (other: kotlin.Int): kotlin.ranges.IntRange [operator] declared in kotlin.Int' type=kotlin.ranges.IntRange origin=RANGE
|
||||||
|
$this: CONST Int type=kotlin.Int value=0
|
||||||
|
other: GET_VAR 'val y: kotlin.Int [val] declared in <root>.test' type=kotlin.Int 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.IntIterator [val] declared in <root>.test.localFunc.<anonymous>' type=kotlin.collections.IntIterator origin=null
|
||||||
|
body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE
|
||||||
|
VAR FOR_LOOP_VARIABLE name:j 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_2: kotlin.collections.IntIterator [val] declared in <root>.test.localFunc.<anonymous>' type=kotlin.collections.IntIterator origin=null
|
||||||
|
CALL 'public final fun appendLine (value: kotlin.String?): java.lang.StringBuilder [inline] declared in kotlin.text.StringsKt' type=java.lang.StringBuilder origin=null
|
||||||
|
$receiver: GET_VAR '<this>: java.lang.StringBuilder declared in <root>.test.localFunc.<anonymous>' type=java.lang.StringBuilder origin=null
|
||||||
|
value: STRING_CONCATENATION type=kotlin.String
|
||||||
|
CALL 'public open fun toString (): kotlin.String declared in kotlin.Any' type=kotlin.String origin=null
|
||||||
|
$this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=MUL
|
||||||
|
$this: GET_VAR 'val i: kotlin.Int [val] declared in <root>.test.localFunc' type=kotlin.Int origin=null
|
||||||
|
other: GET_VAR 'val j: kotlin.Int [val] declared in <root>.test.localFunc.<anonymous>' type=kotlin.Int origin=null
|
||||||
|
CALL 'public final fun takeString (s: kotlin.String): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
|
||||||
|
s: GET_VAR 'val s: kotlin.String [val] declared in <root>.test.localFunc' type=kotlin.String origin=null
|
||||||
|
CALL 'local final fun localFunc (): kotlin.Unit declared in <root>.test' type=kotlin.Unit origin=null
|
||||||
|
FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String
|
||||||
|
BLOCK_BODY
|
||||||
|
CALL 'public final fun test (): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
|
||||||
|
RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in <root>'
|
||||||
|
WHEN type=kotlin.String origin=IF
|
||||||
|
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: CALL 'public final fun <get-result> (): kotlin.Int declared in <root>' type=kotlin.Int origin=GET_PROPERTY
|
||||||
|
arg1: CONST Int type=kotlin.Int value=3025
|
||||||
|
then: CONST String type=kotlin.String value="OK"
|
||||||
|
BRANCH
|
||||||
|
if: CONST Boolean type=kotlin.Boolean value=true
|
||||||
|
then: STRING_CONCATENATION type=kotlin.String
|
||||||
|
CONST String type=kotlin.String value="Fail: "
|
||||||
|
CALL 'public open fun toString (): kotlin.String declared in kotlin.Any' type=kotlin.String origin=null
|
||||||
|
$this: CALL 'public final fun <get-result> (): kotlin.Int declared in <root>' type=kotlin.Int origin=GET_PROPERTY
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
// TARGET_BACKEND: JVM_IR
|
||||||
|
// DUMP_IR
|
||||||
|
// WITH_STDLIB
|
||||||
|
|
||||||
|
var result = 0
|
||||||
|
|
||||||
|
fun takeString(s: String) {
|
||||||
|
s.split("\n").forEach {
|
||||||
|
result += it.toIntOrNull() ?: 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun test() {
|
||||||
|
val x = 10
|
||||||
|
val y = 10
|
||||||
|
|
||||||
|
fun localFunc() {
|
||||||
|
for (i in 0..x) {
|
||||||
|
val s = buildString {
|
||||||
|
for (j in 0..y) {
|
||||||
|
appendLine("${i * j}")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
takeString(s)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
localFunc()
|
||||||
|
}
|
||||||
|
|
||||||
|
fun box(): String {
|
||||||
|
test()
|
||||||
|
return if (result == 3025) "OK" else "Fail: $result"
|
||||||
|
}
|
||||||
@@ -0,0 +1,113 @@
|
|||||||
|
FILE fqName:<root> fileName:/noSymbolForIntRangeIterator.kt
|
||||||
|
PROPERTY name:result visibility:public modality:FINAL [var]
|
||||||
|
FIELD PROPERTY_BACKING_FIELD name:result type:kotlin.Int visibility:private [static]
|
||||||
|
EXPRESSION_BODY
|
||||||
|
CONST Int type=kotlin.Int value=0
|
||||||
|
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-result> visibility:public modality:FINAL <> () returnType:kotlin.Int
|
||||||
|
correspondingProperty: PROPERTY name:result visibility:public modality:FINAL [var]
|
||||||
|
BLOCK_BODY
|
||||||
|
RETURN type=kotlin.Nothing from='public final fun <get-result> (): kotlin.Int declared in <root>'
|
||||||
|
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:result type:kotlin.Int visibility:private [static]' type=kotlin.Int origin=null
|
||||||
|
FUN DEFAULT_PROPERTY_ACCESSOR name:<set-result> visibility:public modality:FINAL <> (<set-?>:kotlin.Int) returnType:kotlin.Unit
|
||||||
|
correspondingProperty: PROPERTY name:result visibility:public modality:FINAL [var]
|
||||||
|
VALUE_PARAMETER name:<set-?> index:0 type:kotlin.Int
|
||||||
|
BLOCK_BODY
|
||||||
|
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:result type:kotlin.Int visibility:private [static]' type=kotlin.Unit origin=null
|
||||||
|
value: GET_VAR '<set-?>: kotlin.Int declared in <root>.<set-result>' type=kotlin.Int origin=null
|
||||||
|
FUN name:takeString visibility:public modality:FINAL <> (s:kotlin.String) returnType:kotlin.Unit
|
||||||
|
VALUE_PARAMETER name:s index:0 type:kotlin.String
|
||||||
|
BLOCK_BODY
|
||||||
|
CALL 'public final fun forEach <T> (action: kotlin.Function1<T of kotlin.collections.CollectionsKt.forEach, kotlin.Unit>): kotlin.Unit [inline] declared in kotlin.collections.CollectionsKt' type=kotlin.Unit origin=null
|
||||||
|
<T>: kotlin.String
|
||||||
|
$receiver: CALL 'public final fun split (vararg delimiters: kotlin.String, ignoreCase: kotlin.Boolean, limit: kotlin.Int): kotlin.collections.List<kotlin.String> declared in kotlin.text.StringsKt' type=kotlin.collections.List<kotlin.String> origin=null
|
||||||
|
$receiver: GET_VAR 's: kotlin.String declared in <root>.takeString' type=kotlin.String origin=null
|
||||||
|
delimiters: VARARG type=kotlin.Array<out kotlin.String> varargElementType=kotlin.String
|
||||||
|
CONST String type=kotlin.String value="\n"
|
||||||
|
action: FUN_EXPR type=kotlin.Function1<kotlin.String, kotlin.Unit> origin=LAMBDA
|
||||||
|
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> (it:kotlin.String) returnType:kotlin.Unit
|
||||||
|
VALUE_PARAMETER name:it index:0 type:kotlin.String
|
||||||
|
BLOCK_BODY
|
||||||
|
BLOCK type=kotlin.Unit origin=PLUSEQ
|
||||||
|
CALL 'public final fun <set-result> (<set-?>: kotlin.Int): kotlin.Unit declared in <root>' type=kotlin.Unit origin=PLUSEQ
|
||||||
|
<set-?>: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=PLUSEQ
|
||||||
|
$this: CALL 'public final fun <get-result> (): kotlin.Int declared in <root>' type=kotlin.Int origin=PLUSEQ
|
||||||
|
other: BLOCK type=kotlin.Int origin=ELVIS
|
||||||
|
VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.Int? [val]
|
||||||
|
CALL 'public final fun toIntOrNull (): kotlin.Int? declared in kotlin.text.StringsKt' type=kotlin.Int? origin=null
|
||||||
|
$receiver: GET_VAR 'it: kotlin.String declared in <root>.takeString.<anonymous>' type=kotlin.String origin=null
|
||||||
|
WHEN type=kotlin.Int origin=null
|
||||||
|
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_0: kotlin.Int? [val] declared in <root>.takeString.<anonymous>' type=kotlin.Int? origin=null
|
||||||
|
arg1: CONST Null type=kotlin.Nothing? value=null
|
||||||
|
then: CONST Int type=kotlin.Int value=0
|
||||||
|
BRANCH
|
||||||
|
if: CONST Boolean type=kotlin.Boolean value=true
|
||||||
|
then: GET_VAR 'val tmp_0: kotlin.Int? [val] declared in <root>.takeString.<anonymous>' type=kotlin.Int? origin=null
|
||||||
|
FUN name:test visibility:public modality:FINAL <> () returnType:kotlin.Unit
|
||||||
|
BLOCK_BODY
|
||||||
|
VAR name:x type:kotlin.Int [val]
|
||||||
|
CONST Int type=kotlin.Int value=10
|
||||||
|
VAR name:y type:kotlin.Int [val]
|
||||||
|
CONST Int type=kotlin.Int value=10
|
||||||
|
FUN name:localFunc visibility:local modality:FINAL <> () returnType:kotlin.Unit
|
||||||
|
BLOCK_BODY
|
||||||
|
BLOCK type=kotlin.Unit origin=FOR_LOOP
|
||||||
|
VAR FOR_LOOP_ITERATOR name:tmp_1 type:kotlin.collections.IntIterator [val]
|
||||||
|
CALL 'public open fun iterator (): kotlin.collections.IntIterator [fake_override,operator] declared in kotlin.ranges.IntRange' type=kotlin.collections.IntIterator origin=FOR_LOOP_ITERATOR
|
||||||
|
$this: CALL 'public final fun rangeTo (other: kotlin.Int): kotlin.ranges.IntRange [operator] declared in kotlin.Int' type=kotlin.ranges.IntRange origin=RANGE
|
||||||
|
$this: CONST Int type=kotlin.Int value=0
|
||||||
|
other: GET_VAR 'val x: kotlin.Int [val] declared in <root>.test' type=kotlin.Int origin=null
|
||||||
|
WHILE label=null origin=FOR_LOOP_INNER_WHILE
|
||||||
|
condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [fake_override,operator] declared in kotlin.collections.IntIterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT
|
||||||
|
$this: GET_VAR 'val tmp_1: kotlin.collections.IntIterator [val] declared in <root>.test.localFunc' 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_1: kotlin.collections.IntIterator [val] declared in <root>.test.localFunc' type=kotlin.collections.IntIterator origin=null
|
||||||
|
BLOCK type=kotlin.Unit origin=null
|
||||||
|
VAR name:s type:kotlin.String [val]
|
||||||
|
CALL 'public final fun buildString (builderAction: @[ExtensionFunctionType] kotlin.Function1<java.lang.StringBuilder{ kotlin.text.TypeAliasesKt.StringBuilder }, kotlin.Unit>): kotlin.String [inline] declared in kotlin.text.StringsKt' type=kotlin.String origin=null
|
||||||
|
builderAction: FUN_EXPR type=@[ExtensionFunctionType] kotlin.Function1<java.lang.StringBuilder{ kotlin.text.TypeAliasesKt.StringBuilder }, kotlin.Unit> origin=LAMBDA
|
||||||
|
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> ($receiver:java.lang.StringBuilder{ kotlin.text.TypeAliasesKt.StringBuilder }) returnType:kotlin.Unit
|
||||||
|
$receiver: VALUE_PARAMETER name:$this$buildString type:java.lang.StringBuilder{ kotlin.text.TypeAliasesKt.StringBuilder }
|
||||||
|
BLOCK_BODY
|
||||||
|
BLOCK type=kotlin.Unit origin=FOR_LOOP
|
||||||
|
VAR FOR_LOOP_ITERATOR name:tmp_2 type:kotlin.collections.IntIterator [val]
|
||||||
|
CALL 'public open fun iterator (): kotlin.collections.IntIterator [fake_override,operator] declared in kotlin.ranges.IntRange' type=kotlin.collections.IntIterator origin=FOR_LOOP_ITERATOR
|
||||||
|
$this: CALL 'public final fun rangeTo (other: kotlin.Int): kotlin.ranges.IntRange [operator] declared in kotlin.Int' type=kotlin.ranges.IntRange origin=RANGE
|
||||||
|
$this: CONST Int type=kotlin.Int value=0
|
||||||
|
other: GET_VAR 'val y: kotlin.Int [val] declared in <root>.test' type=kotlin.Int origin=null
|
||||||
|
WHILE label=null origin=FOR_LOOP_INNER_WHILE
|
||||||
|
condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [fake_override,operator] declared in kotlin.collections.IntIterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT
|
||||||
|
$this: GET_VAR 'val tmp_2: kotlin.collections.IntIterator [val] declared in <root>.test.localFunc.<anonymous>' type=kotlin.collections.IntIterator origin=null
|
||||||
|
body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE
|
||||||
|
VAR FOR_LOOP_VARIABLE name:j 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_2: kotlin.collections.IntIterator [val] declared in <root>.test.localFunc.<anonymous>' type=kotlin.collections.IntIterator origin=null
|
||||||
|
BLOCK type=kotlin.Unit origin=null
|
||||||
|
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
||||||
|
CALL 'public final fun appendLine (value: kotlin.String?): java.lang.StringBuilder{ kotlin.text.TypeAliasesKt.StringBuilder } [inline] declared in kotlin.text.StringsKt' type=java.lang.StringBuilder{ kotlin.text.TypeAliasesKt.StringBuilder } origin=null
|
||||||
|
$receiver: GET_VAR '$this$buildString: java.lang.StringBuilder{ kotlin.text.TypeAliasesKt.StringBuilder } declared in <root>.test.localFunc.<anonymous>' type=java.lang.StringBuilder{ kotlin.text.TypeAliasesKt.StringBuilder } origin=null
|
||||||
|
value: STRING_CONCATENATION type=kotlin.String
|
||||||
|
CALL 'public final fun times (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=MUL
|
||||||
|
$this: GET_VAR 'val i: kotlin.Int [val] declared in <root>.test.localFunc' type=kotlin.Int origin=null
|
||||||
|
other: GET_VAR 'val j: kotlin.Int [val] declared in <root>.test.localFunc.<anonymous>' type=kotlin.Int origin=null
|
||||||
|
CALL 'public final fun takeString (s: kotlin.String): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
|
||||||
|
s: GET_VAR 'val s: kotlin.String [val] declared in <root>.test.localFunc' type=kotlin.String origin=null
|
||||||
|
CALL 'local final fun localFunc (): kotlin.Unit declared in <root>.test' type=kotlin.Unit origin=null
|
||||||
|
FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String
|
||||||
|
BLOCK_BODY
|
||||||
|
CALL 'public final fun test (): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
|
||||||
|
RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in <root>'
|
||||||
|
WHEN type=kotlin.String origin=IF
|
||||||
|
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: CALL 'public final fun <get-result> (): kotlin.Int declared in <root>' type=kotlin.Int origin=GET_PROPERTY
|
||||||
|
arg1: CONST Int type=kotlin.Int value=3025
|
||||||
|
then: CONST String type=kotlin.String value="OK"
|
||||||
|
BRANCH
|
||||||
|
if: CONST Boolean type=kotlin.Boolean value=true
|
||||||
|
then: STRING_CONCATENATION type=kotlin.String
|
||||||
|
CONST String type=kotlin.String value="Fail: "
|
||||||
|
CALL 'public final fun <get-result> (): kotlin.Int declared in <root>' type=kotlin.Int origin=GET_PROPERTY
|
||||||
Vendored
+3
@@ -4,9 +4,11 @@ fun sum(vararg args: Int): Int {
|
|||||||
val <iterator>: IntIterator = args.iterator()
|
val <iterator>: IntIterator = args.iterator()
|
||||||
while (<iterator>.hasNext()) { // BLOCK
|
while (<iterator>.hasNext()) { // BLOCK
|
||||||
val arg: Int = <iterator>.next()
|
val arg: Int = <iterator>.next()
|
||||||
|
{ // BLOCK
|
||||||
result = result.plus(other = arg)
|
result = result.plus(other = arg)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -53,3 +55,4 @@ fun testArrayAndDefaults() {
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
@@ -15,6 +15,7 @@ FILE fqName:<root> fileName:/withVarargViewedAsArray.kt
|
|||||||
VAR FOR_LOOP_VARIABLE name:arg type:kotlin.Int [val]
|
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
|
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 <root>.sum' type=kotlin.collections.IntIterator origin=null
|
$this: GET_VAR 'val tmp_0: kotlin.collections.IntIterator [val] declared in <root>.sum' type=kotlin.collections.IntIterator origin=null
|
||||||
|
BLOCK type=kotlin.Unit origin=null
|
||||||
SET_VAR 'var result: kotlin.Int [var] declared in <root>.sum' type=kotlin.Unit origin=EQ
|
SET_VAR 'var result: kotlin.Int [var] declared in <root>.sum' type=kotlin.Unit origin=EQ
|
||||||
CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int 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 <root>.sum' type=kotlin.Int origin=null
|
$this: GET_VAR 'var result: kotlin.Int [var] declared in <root>.sum' type=kotlin.Int origin=null
|
||||||
|
|||||||
@@ -22,12 +22,14 @@ fun testDestructuring(pp: List<Pair<Int, String>>) {
|
|||||||
val <iterator>: Iterator<Pair<Int, String>> = pp.iterator()
|
val <iterator>: Iterator<Pair<Int, String>> = pp.iterator()
|
||||||
while (<iterator>.hasNext()) { // BLOCK
|
while (<iterator>.hasNext()) { // BLOCK
|
||||||
val <destruct>: Pair<Int, String> = <iterator>.next()
|
val <destruct>: Pair<Int, String> = <iterator>.next()
|
||||||
|
{ // BLOCK
|
||||||
val i: Int = <destruct>.component1()
|
val i: Int = <destruct>.component1()
|
||||||
val s: String = <destruct>.component2()
|
val s: String = <destruct>.component2()
|
||||||
println(message = i)
|
println(message = i)
|
||||||
println(message = s)
|
println(message = s)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun testRange() {
|
fun testRange() {
|
||||||
@@ -38,3 +40,4 @@ fun testRange() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ FILE fqName:<root> fileName:/for.kt
|
|||||||
VAR FOR_LOOP_VARIABLE name:<destruct> type:kotlin.Pair<kotlin.Int, kotlin.String> [val]
|
VAR FOR_LOOP_VARIABLE name:<destruct> type:kotlin.Pair<kotlin.Int, kotlin.String> [val]
|
||||||
CALL 'public abstract fun next (): T of kotlin.collections.Iterator [operator] declared in kotlin.collections.Iterator' type=kotlin.Pair<kotlin.Int, kotlin.String> origin=FOR_LOOP_NEXT
|
CALL 'public abstract fun next (): T of kotlin.collections.Iterator [operator] declared in kotlin.collections.Iterator' type=kotlin.Pair<kotlin.Int, kotlin.String> origin=FOR_LOOP_NEXT
|
||||||
$this: GET_VAR 'val tmp_2: kotlin.collections.Iterator<kotlin.Pair<kotlin.Int, kotlin.String>> [val] declared in <root>.testDestructuring' type=kotlin.collections.Iterator<kotlin.Pair<kotlin.Int, kotlin.String>> origin=null
|
$this: GET_VAR 'val tmp_2: kotlin.collections.Iterator<kotlin.Pair<kotlin.Int, kotlin.String>> [val] declared in <root>.testDestructuring' type=kotlin.collections.Iterator<kotlin.Pair<kotlin.Int, kotlin.String>> origin=null
|
||||||
|
BLOCK type=kotlin.Unit origin=null
|
||||||
VAR name:i type:kotlin.Int [val]
|
VAR name:i type:kotlin.Int [val]
|
||||||
CALL 'public final fun component1 (): A of kotlin.Pair [operator] declared in kotlin.Pair' type=kotlin.Int origin=null
|
CALL 'public final fun component1 (): A of kotlin.Pair [operator] declared in kotlin.Pair' type=kotlin.Int origin=null
|
||||||
$this: GET_VAR 'val <destruct>: kotlin.Pair<kotlin.Int, kotlin.String> [val] declared in <root>.testDestructuring' type=kotlin.Pair<kotlin.Int, kotlin.String> origin=null
|
$this: GET_VAR 'val <destruct>: kotlin.Pair<kotlin.Int, kotlin.String> [val] declared in <root>.testDestructuring' type=kotlin.Pair<kotlin.Int, kotlin.String> origin=null
|
||||||
|
|||||||
@@ -13,18 +13,22 @@ fun testForBreak2(ss: List<String>) {
|
|||||||
val <iterator>: Iterator<String> = ss.iterator()
|
val <iterator>: Iterator<String> = ss.iterator()
|
||||||
OUTER@ while (<iterator>.hasNext()) { // BLOCK
|
OUTER@ while (<iterator>.hasNext()) { // BLOCK
|
||||||
val s1: String = <iterator>.next()
|
val s1: String = <iterator>.next()
|
||||||
|
{ // BLOCK
|
||||||
{ // BLOCK
|
{ // BLOCK
|
||||||
val <iterator>: Iterator<String> = ss.iterator()
|
val <iterator>: Iterator<String> = ss.iterator()
|
||||||
INNER@ while (<iterator>.hasNext()) { // BLOCK
|
INNER@ while (<iterator>.hasNext()) { // BLOCK
|
||||||
val s2: String = <iterator>.next()
|
val s2: String = <iterator>.next()
|
||||||
|
{ // BLOCK
|
||||||
break@OUTER
|
break@OUTER
|
||||||
break@INNER
|
break@INNER
|
||||||
break@INNER
|
break@INNER
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
break@OUTER
|
break@OUTER
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun testForContinue1(ss: List<String>) {
|
fun testForContinue1(ss: List<String>) {
|
||||||
@@ -42,16 +46,21 @@ fun testForContinue2(ss: List<String>) {
|
|||||||
val <iterator>: Iterator<String> = ss.iterator()
|
val <iterator>: Iterator<String> = ss.iterator()
|
||||||
OUTER@ while (<iterator>.hasNext()) { // BLOCK
|
OUTER@ while (<iterator>.hasNext()) { // BLOCK
|
||||||
val s1: String = <iterator>.next()
|
val s1: String = <iterator>.next()
|
||||||
|
{ // BLOCK
|
||||||
{ // BLOCK
|
{ // BLOCK
|
||||||
val <iterator>: Iterator<String> = ss.iterator()
|
val <iterator>: Iterator<String> = ss.iterator()
|
||||||
INNER@ while (<iterator>.hasNext()) { // BLOCK
|
INNER@ while (<iterator>.hasNext()) { // BLOCK
|
||||||
val s2: String = <iterator>.next()
|
val s2: String = <iterator>.next()
|
||||||
|
{ // BLOCK
|
||||||
continue@OUTER
|
continue@OUTER
|
||||||
continue@INNER
|
continue@INNER
|
||||||
continue@INNER
|
continue@INNER
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
continue@OUTER
|
continue@OUTER
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ FILE fqName:<root> fileName:/forWithBreakContinue.kt
|
|||||||
WHILE label=null origin=FOR_LOOP_INNER_WHILE
|
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
|
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<kotlin.String> [val] declared in <root>.testForBreak1' type=kotlin.collections.Iterator<kotlin.String> origin=null
|
$this: GET_VAR 'val tmp_0: kotlin.collections.Iterator<kotlin.String> [val] declared in <root>.testForBreak1' type=kotlin.collections.Iterator<kotlin.String> origin=null
|
||||||
body: BLOCK type=kotlin.Nothing origin=FOR_LOOP_INNER_WHILE
|
body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE
|
||||||
VAR FOR_LOOP_VARIABLE name:s type:kotlin.String [val]
|
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
|
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<kotlin.String> [val] declared in <root>.testForBreak1' type=kotlin.collections.Iterator<kotlin.String> origin=null
|
$this: GET_VAR 'val tmp_0: kotlin.collections.Iterator<kotlin.String> [val] declared in <root>.testForBreak1' type=kotlin.collections.Iterator<kotlin.String> origin=null
|
||||||
@@ -24,10 +24,11 @@ FILE fqName:<root> fileName:/forWithBreakContinue.kt
|
|||||||
WHILE label=OUTER origin=FOR_LOOP_INNER_WHILE
|
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
|
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<kotlin.String> [val] declared in <root>.testForBreak2' type=kotlin.collections.Iterator<kotlin.String> origin=null
|
$this: GET_VAR 'val tmp_1: kotlin.collections.Iterator<kotlin.String> [val] declared in <root>.testForBreak2' type=kotlin.collections.Iterator<kotlin.String> origin=null
|
||||||
body: BLOCK type=kotlin.Nothing origin=FOR_LOOP_INNER_WHILE
|
body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE
|
||||||
VAR FOR_LOOP_VARIABLE name:s1 type:kotlin.String [val]
|
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
|
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<kotlin.String> [val] declared in <root>.testForBreak2' type=kotlin.collections.Iterator<kotlin.String> origin=null
|
$this: GET_VAR 'val tmp_1: kotlin.collections.Iterator<kotlin.String> [val] declared in <root>.testForBreak2' type=kotlin.collections.Iterator<kotlin.String> origin=null
|
||||||
|
BLOCK type=kotlin.Nothing origin=null
|
||||||
BLOCK type=kotlin.Unit origin=FOR_LOOP
|
BLOCK type=kotlin.Unit origin=FOR_LOOP
|
||||||
VAR FOR_LOOP_ITERATOR name:tmp_2 type:kotlin.collections.Iterator<kotlin.String> [val]
|
VAR FOR_LOOP_ITERATOR name:tmp_2 type:kotlin.collections.Iterator<kotlin.String> [val]
|
||||||
CALL 'public abstract fun iterator (): kotlin.collections.Iterator<E of kotlin.collections.List> [operator] declared in kotlin.collections.List' type=kotlin.collections.Iterator<kotlin.String> origin=FOR_LOOP_ITERATOR
|
CALL 'public abstract fun iterator (): kotlin.collections.Iterator<E of kotlin.collections.List> [operator] declared in kotlin.collections.List' type=kotlin.collections.Iterator<kotlin.String> origin=FOR_LOOP_ITERATOR
|
||||||
@@ -35,10 +36,11 @@ FILE fqName:<root> fileName:/forWithBreakContinue.kt
|
|||||||
WHILE label=INNER origin=FOR_LOOP_INNER_WHILE
|
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
|
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<kotlin.String> [val] declared in <root>.testForBreak2' type=kotlin.collections.Iterator<kotlin.String> origin=null
|
$this: GET_VAR 'val tmp_2: kotlin.collections.Iterator<kotlin.String> [val] declared in <root>.testForBreak2' type=kotlin.collections.Iterator<kotlin.String> origin=null
|
||||||
body: BLOCK type=kotlin.Nothing origin=FOR_LOOP_INNER_WHILE
|
body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE
|
||||||
VAR FOR_LOOP_VARIABLE name:s2 type:kotlin.String [val]
|
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
|
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<kotlin.String> [val] declared in <root>.testForBreak2' type=kotlin.collections.Iterator<kotlin.String> origin=null
|
$this: GET_VAR 'val tmp_2: kotlin.collections.Iterator<kotlin.String> [val] declared in <root>.testForBreak2' type=kotlin.collections.Iterator<kotlin.String> origin=null
|
||||||
|
BLOCK type=kotlin.Nothing origin=null
|
||||||
BREAK label=OUTER loop.label=OUTER
|
BREAK label=OUTER loop.label=OUTER
|
||||||
BREAK label=INNER loop.label=INNER
|
BREAK label=INNER loop.label=INNER
|
||||||
BREAK label=INNER loop.label=INNER
|
BREAK label=INNER loop.label=INNER
|
||||||
@@ -53,7 +55,7 @@ FILE fqName:<root> fileName:/forWithBreakContinue.kt
|
|||||||
WHILE label=null origin=FOR_LOOP_INNER_WHILE
|
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
|
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<kotlin.String> [val] declared in <root>.testForContinue1' type=kotlin.collections.Iterator<kotlin.String> origin=null
|
$this: GET_VAR 'val tmp_3: kotlin.collections.Iterator<kotlin.String> [val] declared in <root>.testForContinue1' type=kotlin.collections.Iterator<kotlin.String> origin=null
|
||||||
body: BLOCK type=kotlin.Nothing origin=FOR_LOOP_INNER_WHILE
|
body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE
|
||||||
VAR FOR_LOOP_VARIABLE name:s type:kotlin.String [val]
|
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
|
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<kotlin.String> [val] declared in <root>.testForContinue1' type=kotlin.collections.Iterator<kotlin.String> origin=null
|
$this: GET_VAR 'val tmp_3: kotlin.collections.Iterator<kotlin.String> [val] declared in <root>.testForContinue1' type=kotlin.collections.Iterator<kotlin.String> origin=null
|
||||||
@@ -68,10 +70,11 @@ FILE fqName:<root> fileName:/forWithBreakContinue.kt
|
|||||||
WHILE label=OUTER origin=FOR_LOOP_INNER_WHILE
|
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
|
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<kotlin.String> [val] declared in <root>.testForContinue2' type=kotlin.collections.Iterator<kotlin.String> origin=null
|
$this: GET_VAR 'val tmp_4: kotlin.collections.Iterator<kotlin.String> [val] declared in <root>.testForContinue2' type=kotlin.collections.Iterator<kotlin.String> origin=null
|
||||||
body: BLOCK type=kotlin.Nothing origin=FOR_LOOP_INNER_WHILE
|
body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE
|
||||||
VAR FOR_LOOP_VARIABLE name:s1 type:kotlin.String [val]
|
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
|
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<kotlin.String> [val] declared in <root>.testForContinue2' type=kotlin.collections.Iterator<kotlin.String> origin=null
|
$this: GET_VAR 'val tmp_4: kotlin.collections.Iterator<kotlin.String> [val] declared in <root>.testForContinue2' type=kotlin.collections.Iterator<kotlin.String> origin=null
|
||||||
|
BLOCK type=kotlin.Nothing origin=null
|
||||||
BLOCK type=kotlin.Unit origin=FOR_LOOP
|
BLOCK type=kotlin.Unit origin=FOR_LOOP
|
||||||
VAR FOR_LOOP_ITERATOR name:tmp_5 type:kotlin.collections.Iterator<kotlin.String> [val]
|
VAR FOR_LOOP_ITERATOR name:tmp_5 type:kotlin.collections.Iterator<kotlin.String> [val]
|
||||||
CALL 'public abstract fun iterator (): kotlin.collections.Iterator<E of kotlin.collections.List> [operator] declared in kotlin.collections.List' type=kotlin.collections.Iterator<kotlin.String> origin=FOR_LOOP_ITERATOR
|
CALL 'public abstract fun iterator (): kotlin.collections.Iterator<E of kotlin.collections.List> [operator] declared in kotlin.collections.List' type=kotlin.collections.Iterator<kotlin.String> origin=FOR_LOOP_ITERATOR
|
||||||
@@ -79,10 +82,11 @@ FILE fqName:<root> fileName:/forWithBreakContinue.kt
|
|||||||
WHILE label=INNER origin=FOR_LOOP_INNER_WHILE
|
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
|
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<kotlin.String> [val] declared in <root>.testForContinue2' type=kotlin.collections.Iterator<kotlin.String> origin=null
|
$this: GET_VAR 'val tmp_5: kotlin.collections.Iterator<kotlin.String> [val] declared in <root>.testForContinue2' type=kotlin.collections.Iterator<kotlin.String> origin=null
|
||||||
body: BLOCK type=kotlin.Nothing origin=FOR_LOOP_INNER_WHILE
|
body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE
|
||||||
VAR FOR_LOOP_VARIABLE name:s2 type:kotlin.String [val]
|
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
|
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<kotlin.String> [val] declared in <root>.testForContinue2' type=kotlin.collections.Iterator<kotlin.String> origin=null
|
$this: GET_VAR 'val tmp_5: kotlin.collections.Iterator<kotlin.String> [val] declared in <root>.testForContinue2' type=kotlin.collections.Iterator<kotlin.String> origin=null
|
||||||
|
BLOCK type=kotlin.Nothing origin=null
|
||||||
CONTINUE label=OUTER loop.label=OUTER
|
CONTINUE label=OUTER loop.label=OUTER
|
||||||
CONTINUE label=INNER loop.label=INNER
|
CONTINUE label=INNER loop.label=INNER
|
||||||
CONTINUE label=INNER loop.label=INNER
|
CONTINUE label=INNER loop.label=INNER
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ fun resolveClashesIfAny(container: ComponentContainer, clashResolvers: List<Plat
|
|||||||
val <iterator>: Iterator<PlatformExtensionsClashResolver<*>> = clashResolvers.iterator()
|
val <iterator>: Iterator<PlatformExtensionsClashResolver<*>> = clashResolvers.iterator()
|
||||||
while (<iterator>.hasNext()) { // BLOCK
|
while (<iterator>.hasNext()) { // BLOCK
|
||||||
val resolver: PlatformExtensionsClashResolver<*> = <iterator>.next()
|
val resolver: PlatformExtensionsClashResolver<*> = <iterator>.next()
|
||||||
|
{ // BLOCK
|
||||||
val clashedComponents: Collection<ComponentDescriptor> = { // BLOCK
|
val clashedComponents: Collection<ComponentDescriptor> = { // BLOCK
|
||||||
val <elvis>: Collection<ComponentDescriptor>? = <get-registrationMap>().get(p0 = resolver.<get-applicableTo>()) as? Collection<ComponentDescriptor>
|
val <elvis>: Collection<ComponentDescriptor>? = <get-registrationMap>().get(p0 = resolver.<get-applicableTo>()) as? Collection<ComponentDescriptor>
|
||||||
when {
|
when {
|
||||||
@@ -59,4 +60,6 @@ fun resolveClashesIfAny(container: ComponentContainer, clashResolvers: List<Plat
|
|||||||
val substituteDescriptor: ClashResolutionDescriptor<out PlatformSpecificExtension<out PlatformSpecificExtension<out PlatformSpecificExtension<out PlatformSpecificExtension<out PlatformSpecificExtension<out Any?>>>>>> = ClashResolutionDescriptor<PlatformSpecificExtension<out PlatformSpecificExtension<out PlatformSpecificExtension<out PlatformSpecificExtension<out PlatformSpecificExtension<out Any?>>>>>>(container = container, resolver = resolver, clashedComponents = clashedComponents.toList<ComponentDescriptor>())
|
val substituteDescriptor: ClashResolutionDescriptor<out PlatformSpecificExtension<out PlatformSpecificExtension<out PlatformSpecificExtension<out PlatformSpecificExtension<out PlatformSpecificExtension<out Any?>>>>>> = ClashResolutionDescriptor<PlatformSpecificExtension<out PlatformSpecificExtension<out PlatformSpecificExtension<out PlatformSpecificExtension<out PlatformSpecificExtension<out Any?>>>>>>(container = container, resolver = resolver, clashedComponents = clashedComponents.toList<ComponentDescriptor>())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -148,6 +148,7 @@ FILE fqName:<root> fileName:/ClashResolutionDescriptor.kt
|
|||||||
VAR FOR_LOOP_VARIABLE name:resolver type:<root>.PlatformExtensionsClashResolver<*> [val]
|
VAR FOR_LOOP_VARIABLE name:resolver type:<root>.PlatformExtensionsClashResolver<*> [val]
|
||||||
CALL 'public abstract fun next (): T of kotlin.collections.Iterator [operator] declared in kotlin.collections.Iterator' type=<root>.PlatformExtensionsClashResolver<*> origin=FOR_LOOP_NEXT
|
CALL 'public abstract fun next (): T of kotlin.collections.Iterator [operator] declared in kotlin.collections.Iterator' type=<root>.PlatformExtensionsClashResolver<*> origin=FOR_LOOP_NEXT
|
||||||
$this: GET_VAR 'val tmp_0: kotlin.collections.Iterator<<root>.PlatformExtensionsClashResolver<*>> [val] declared in <root>.resolveClashesIfAny' type=kotlin.collections.Iterator<<root>.PlatformExtensionsClashResolver<*>> origin=null
|
$this: GET_VAR 'val tmp_0: kotlin.collections.Iterator<<root>.PlatformExtensionsClashResolver<*>> [val] declared in <root>.resolveClashesIfAny' type=kotlin.collections.Iterator<<root>.PlatformExtensionsClashResolver<*>> origin=null
|
||||||
|
BLOCK type=kotlin.Unit origin=null
|
||||||
VAR name:clashedComponents type:kotlin.collections.Collection<<root>.ComponentDescriptor> [val]
|
VAR name:clashedComponents type:kotlin.collections.Collection<<root>.ComponentDescriptor> [val]
|
||||||
BLOCK type=kotlin.collections.Collection<<root>.ComponentDescriptor> origin=ELVIS
|
BLOCK type=kotlin.collections.Collection<<root>.ComponentDescriptor> origin=ELVIS
|
||||||
VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.collections.Collection<<root>.ComponentDescriptor>? [val]
|
VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.collections.Collection<<root>.ComponentDescriptor>? [val]
|
||||||
|
|||||||
@@ -55,6 +55,7 @@ class DeepCopyIrTreeWithSymbols {
|
|||||||
val <iterator>: Iterator<Pair<IrTypeParameter, IrTypeParameter>> = <this>.<get-typeParameters>().zip<IrTypeParameter, IrTypeParameter>(other = other.<get-typeParameters>()).iterator()
|
val <iterator>: Iterator<Pair<IrTypeParameter, IrTypeParameter>> = <this>.<get-typeParameters>().zip<IrTypeParameter, IrTypeParameter>(other = other.<get-typeParameters>()).iterator()
|
||||||
while (<iterator>.hasNext()) { // BLOCK
|
while (<iterator>.hasNext()) { // BLOCK
|
||||||
val <destruct>: Pair<IrTypeParameter, IrTypeParameter> = <iterator>.next()
|
val <destruct>: Pair<IrTypeParameter, IrTypeParameter> = <iterator>.next()
|
||||||
|
{ // BLOCK
|
||||||
val thisTypeParameter: IrTypeParameter = <destruct>.component1()
|
val thisTypeParameter: IrTypeParameter = <destruct>.component1()
|
||||||
val otherTypeParameter: IrTypeParameter = <destruct>.component2()
|
val otherTypeParameter: IrTypeParameter = <destruct>.component2()
|
||||||
otherTypeParameter.<get-superTypes>().mapTo<IrType, IrType, MutableList<IrType>>(destination = thisTypeParameter.<get-superTypes>(), transform = local fun <anonymous>(it: IrType): IrType {
|
otherTypeParameter.<get-superTypes>().mapTo<IrType, IrType, MutableList<IrType>>(destination = thisTypeParameter.<get-superTypes>(), transform = local fun <anonymous>(it: IrType): IrType {
|
||||||
@@ -64,6 +65,7 @@ class DeepCopyIrTreeWithSymbols {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -75,3 +77,4 @@ inline fun <T : Any?> TypeRemapper.withinScope(irTypeParametersContainer: IrType
|
|||||||
<this>.leaveScope()
|
<this>.leaveScope()
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -177,10 +177,11 @@ FILE fqName:<root> fileName:/DeepCopyIrTree.kt
|
|||||||
WHILE label=null origin=FOR_LOOP_INNER_WHILE
|
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
|
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<kotlin.Pair<<root>.IrTypeParameter, <root>.IrTypeParameter>> [val] declared in <root>.DeepCopyIrTreeWithSymbols.copyTypeParametersFrom.<anonymous>' type=kotlin.collections.Iterator<kotlin.Pair<<root>.IrTypeParameter, <root>.IrTypeParameter>> origin=null
|
$this: GET_VAR 'val tmp_0: kotlin.collections.Iterator<kotlin.Pair<<root>.IrTypeParameter, <root>.IrTypeParameter>> [val] declared in <root>.DeepCopyIrTreeWithSymbols.copyTypeParametersFrom.<anonymous>' type=kotlin.collections.Iterator<kotlin.Pair<<root>.IrTypeParameter, <root>.IrTypeParameter>> origin=null
|
||||||
body: BLOCK type=kotlin.collections.MutableList<<root>.IrType> origin=FOR_LOOP_INNER_WHILE
|
body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE
|
||||||
VAR FOR_LOOP_VARIABLE name:<destruct> type:kotlin.Pair<<root>.IrTypeParameter, <root>.IrTypeParameter> [val]
|
VAR FOR_LOOP_VARIABLE name:<destruct> type:kotlin.Pair<<root>.IrTypeParameter, <root>.IrTypeParameter> [val]
|
||||||
CALL 'public abstract fun next (): T of kotlin.collections.Iterator [operator] declared in kotlin.collections.Iterator' type=kotlin.Pair<<root>.IrTypeParameter, <root>.IrTypeParameter> origin=FOR_LOOP_NEXT
|
CALL 'public abstract fun next (): T of kotlin.collections.Iterator [operator] declared in kotlin.collections.Iterator' type=kotlin.Pair<<root>.IrTypeParameter, <root>.IrTypeParameter> origin=FOR_LOOP_NEXT
|
||||||
$this: GET_VAR 'val tmp_0: kotlin.collections.Iterator<kotlin.Pair<<root>.IrTypeParameter, <root>.IrTypeParameter>> [val] declared in <root>.DeepCopyIrTreeWithSymbols.copyTypeParametersFrom.<anonymous>' type=kotlin.collections.Iterator<kotlin.Pair<<root>.IrTypeParameter, <root>.IrTypeParameter>> origin=null
|
$this: GET_VAR 'val tmp_0: kotlin.collections.Iterator<kotlin.Pair<<root>.IrTypeParameter, <root>.IrTypeParameter>> [val] declared in <root>.DeepCopyIrTreeWithSymbols.copyTypeParametersFrom.<anonymous>' type=kotlin.collections.Iterator<kotlin.Pair<<root>.IrTypeParameter, <root>.IrTypeParameter>> origin=null
|
||||||
|
BLOCK type=kotlin.collections.MutableList<<root>.IrType> origin=null
|
||||||
VAR name:thisTypeParameter type:<root>.IrTypeParameter [val]
|
VAR name:thisTypeParameter type:<root>.IrTypeParameter [val]
|
||||||
CALL 'public final fun component1 (): A of kotlin.Pair [operator] declared in kotlin.Pair' type=<root>.IrTypeParameter origin=null
|
CALL 'public final fun component1 (): A of kotlin.Pair [operator] declared in kotlin.Pair' type=<root>.IrTypeParameter origin=null
|
||||||
$this: GET_VAR 'val <destruct>: kotlin.Pair<<root>.IrTypeParameter, <root>.IrTypeParameter> [val] declared in <root>.DeepCopyIrTreeWithSymbols.copyTypeParametersFrom.<anonymous>' type=kotlin.Pair<<root>.IrTypeParameter, <root>.IrTypeParameter> origin=null
|
$this: GET_VAR 'val <destruct>: kotlin.Pair<<root>.IrTypeParameter, <root>.IrTypeParameter> [val] declared in <root>.DeepCopyIrTreeWithSymbols.copyTypeParametersFrom.<anonymous>' type=kotlin.Pair<<root>.IrTypeParameter, <root>.IrTypeParameter> origin=null
|
||||||
|
|||||||
+6
@@ -15,10 +15,12 @@ fun testForInListDestructured() {
|
|||||||
val <iterator>: MutableIterator<@FlexibleNullability P?> = listOfNotNull().iterator()
|
val <iterator>: MutableIterator<@FlexibleNullability P?> = listOfNotNull().iterator()
|
||||||
while (<iterator>.hasNext()) { // BLOCK
|
while (<iterator>.hasNext()) { // BLOCK
|
||||||
val <destruct>: @FlexibleNullability P? = <iterator>.next()
|
val <destruct>: @FlexibleNullability P? = <iterator>.next()
|
||||||
|
{ // BLOCK
|
||||||
val x: Int = <destruct>.component1()
|
val x: Int = <destruct>.component1()
|
||||||
val y: Int = <destruct>.component2()
|
val y: Int = <destruct>.component2()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun testDesugaredForInList() {
|
fun testDesugaredForInList() {
|
||||||
@@ -42,10 +44,12 @@ fun testForInListUse() {
|
|||||||
val <iterator>: MutableIterator<@FlexibleNullability P?> = listOfNotNull().iterator()
|
val <iterator>: MutableIterator<@FlexibleNullability P?> = listOfNotNull().iterator()
|
||||||
while (<iterator>.hasNext()) { // BLOCK
|
while (<iterator>.hasNext()) { // BLOCK
|
||||||
val x: @FlexibleNullability P? = <iterator>.next()
|
val x: @FlexibleNullability P? = <iterator>.next()
|
||||||
|
{ // BLOCK
|
||||||
use(s = x /*!! @FlexibleNullability P */)
|
use(s = x /*!! @FlexibleNullability P */)
|
||||||
use(s = x)
|
use(s = x)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun testForInArrayUse(j: J) {
|
fun testForInArrayUse(j: J) {
|
||||||
@@ -53,10 +57,12 @@ fun testForInArrayUse(j: J) {
|
|||||||
val <iterator>: Iterator<@FlexibleNullability P?> = j.arrayOfNotNull().iterator()
|
val <iterator>: Iterator<@FlexibleNullability P?> = j.arrayOfNotNull().iterator()
|
||||||
while (<iterator>.hasNext()) { // BLOCK
|
while (<iterator>.hasNext()) { // BLOCK
|
||||||
val x: @FlexibleNullability P? = <iterator>.next()
|
val x: @FlexibleNullability P? = <iterator>.next()
|
||||||
|
{ // BLOCK
|
||||||
use(s = x /*!! @FlexibleNullability P */)
|
use(s = x /*!! @FlexibleNullability P */)
|
||||||
use(s = x)
|
use(s = x)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
interface K {
|
interface K {
|
||||||
|
|||||||
+3
@@ -28,6 +28,7 @@ FILE fqName:<root> fileName:/enhancedNullabilityInForLoop.kt
|
|||||||
VAR FOR_LOOP_VARIABLE name:<destruct> type:@[FlexibleNullability] <root>.P? [val]
|
VAR FOR_LOOP_VARIABLE name:<destruct> type:@[FlexibleNullability] <root>.P? [val]
|
||||||
CALL 'public abstract fun next (): T of kotlin.collections.MutableIterator [fake_override,operator] declared in kotlin.collections.MutableIterator' type=@[FlexibleNullability] <root>.P? origin=FOR_LOOP_NEXT
|
CALL 'public abstract fun next (): T of kotlin.collections.MutableIterator [fake_override,operator] declared in kotlin.collections.MutableIterator' type=@[FlexibleNullability] <root>.P? origin=FOR_LOOP_NEXT
|
||||||
$this: GET_VAR 'val tmp_1: kotlin.collections.MutableIterator<@[FlexibleNullability] <root>.P?> [val] declared in <root>.testForInListDestructured' type=kotlin.collections.MutableIterator<@[FlexibleNullability] <root>.P?> origin=null
|
$this: GET_VAR 'val tmp_1: kotlin.collections.MutableIterator<@[FlexibleNullability] <root>.P?> [val] declared in <root>.testForInListDestructured' type=kotlin.collections.MutableIterator<@[FlexibleNullability] <root>.P?> origin=null
|
||||||
|
BLOCK type=kotlin.Unit origin=null
|
||||||
VAR name:x type:kotlin.Int [val]
|
VAR name:x type:kotlin.Int [val]
|
||||||
CALL 'public final fun component1 (): kotlin.Int [operator] declared in <root>.P' type=kotlin.Int origin=null
|
CALL 'public final fun component1 (): kotlin.Int [operator] declared in <root>.P' type=kotlin.Int origin=null
|
||||||
$this: GET_VAR 'val <destruct>: @[FlexibleNullability] <root>.P? [val] declared in <root>.testForInListDestructured' type=@[FlexibleNullability] <root>.P? origin=null
|
$this: GET_VAR 'val <destruct>: @[FlexibleNullability] <root>.P? [val] declared in <root>.testForInListDestructured' type=@[FlexibleNullability] <root>.P? origin=null
|
||||||
@@ -74,6 +75,7 @@ FILE fqName:<root> fileName:/enhancedNullabilityInForLoop.kt
|
|||||||
VAR FOR_LOOP_VARIABLE name:x type:@[FlexibleNullability] <root>.P? [val]
|
VAR FOR_LOOP_VARIABLE name:x type:@[FlexibleNullability] <root>.P? [val]
|
||||||
CALL 'public abstract fun next (): T of kotlin.collections.MutableIterator [fake_override,operator] declared in kotlin.collections.MutableIterator' type=@[FlexibleNullability] <root>.P? origin=FOR_LOOP_NEXT
|
CALL 'public abstract fun next (): T of kotlin.collections.MutableIterator [fake_override,operator] declared in kotlin.collections.MutableIterator' type=@[FlexibleNullability] <root>.P? origin=FOR_LOOP_NEXT
|
||||||
$this: GET_VAR 'val tmp_3: kotlin.collections.MutableIterator<@[FlexibleNullability] <root>.P?> [val] declared in <root>.testForInListUse' type=kotlin.collections.MutableIterator<@[FlexibleNullability] <root>.P?> origin=null
|
$this: GET_VAR 'val tmp_3: kotlin.collections.MutableIterator<@[FlexibleNullability] <root>.P?> [val] declared in <root>.testForInListUse' type=kotlin.collections.MutableIterator<@[FlexibleNullability] <root>.P?> origin=null
|
||||||
|
BLOCK type=kotlin.Unit origin=null
|
||||||
CALL 'public final fun use (s: <root>.P): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
|
CALL 'public final fun use (s: <root>.P): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
|
||||||
s: TYPE_OP type=@[FlexibleNullability] <root>.P origin=IMPLICIT_NOTNULL typeOperand=@[FlexibleNullability] <root>.P
|
s: TYPE_OP type=@[FlexibleNullability] <root>.P origin=IMPLICIT_NOTNULL typeOperand=@[FlexibleNullability] <root>.P
|
||||||
GET_VAR 'val x: @[FlexibleNullability] <root>.P? [val] declared in <root>.testForInListUse' type=@[FlexibleNullability] <root>.P? origin=null
|
GET_VAR 'val x: @[FlexibleNullability] <root>.P? [val] declared in <root>.testForInListUse' type=@[FlexibleNullability] <root>.P? origin=null
|
||||||
@@ -94,6 +96,7 @@ FILE fqName:<root> fileName:/enhancedNullabilityInForLoop.kt
|
|||||||
VAR FOR_LOOP_VARIABLE name:x type:@[FlexibleNullability] <root>.P? [val]
|
VAR FOR_LOOP_VARIABLE name:x type:@[FlexibleNullability] <root>.P? [val]
|
||||||
CALL 'public abstract fun next (): T of kotlin.collections.Iterator [operator] declared in kotlin.collections.Iterator' type=@[FlexibleNullability] <root>.P? origin=FOR_LOOP_NEXT
|
CALL 'public abstract fun next (): T of kotlin.collections.Iterator [operator] declared in kotlin.collections.Iterator' type=@[FlexibleNullability] <root>.P? origin=FOR_LOOP_NEXT
|
||||||
$this: GET_VAR 'val tmp_4: kotlin.collections.Iterator<@[FlexibleNullability] <root>.P?> [val] declared in <root>.testForInArrayUse' type=kotlin.collections.Iterator<@[FlexibleNullability] <root>.P?> origin=null
|
$this: GET_VAR 'val tmp_4: kotlin.collections.Iterator<@[FlexibleNullability] <root>.P?> [val] declared in <root>.testForInArrayUse' type=kotlin.collections.Iterator<@[FlexibleNullability] <root>.P?> origin=null
|
||||||
|
BLOCK type=kotlin.Unit origin=null
|
||||||
CALL 'public final fun use (s: <root>.P): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
|
CALL 'public final fun use (s: <root>.P): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
|
||||||
s: TYPE_OP type=@[FlexibleNullability] <root>.P origin=IMPLICIT_NOTNULL typeOperand=@[FlexibleNullability] <root>.P
|
s: TYPE_OP type=@[FlexibleNullability] <root>.P origin=IMPLICIT_NOTNULL typeOperand=@[FlexibleNullability] <root>.P
|
||||||
GET_VAR 'val x: @[FlexibleNullability] <root>.P? [val] declared in <root>.testForInArrayUse' type=@[FlexibleNullability] <root>.P? origin=null
|
GET_VAR 'val x: @[FlexibleNullability] <root>.P? [val] declared in <root>.testForInArrayUse' type=@[FlexibleNullability] <root>.P? origin=null
|
||||||
|
|||||||
+6
@@ -15182,6 +15182,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
|||||||
runTest("compiler/testData/codegen/box/fir/NameHighlighter.kt");
|
runTest("compiler/testData/codegen/box/fir/NameHighlighter.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("noSymbolForIntRangeIterator.kt")
|
||||||
|
public void testNoSymbolForIntRangeIterator() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/fir/noSymbolForIntRangeIterator.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("SuspendExtension.kt")
|
@TestMetadata("SuspendExtension.kt")
|
||||||
public void testSuspendExtension() throws Exception {
|
public void testSuspendExtension() throws Exception {
|
||||||
|
|||||||
Reference in New Issue
Block a user