[FIR2IR] Fix conversion of loops with withIndex
This commit is contained in:
committed by
TeamCityServer
parent
a2ec99e38c
commit
b4fada82ae
@@ -466,6 +466,8 @@ internal fun FirReference.statementOrigin(): IrStatementOrigin? {
|
||||
IrStatementOrigin.FOR_LOOP_ITERATOR
|
||||
source?.elementType == KtNodeTypes.OPERATION_REFERENCE ->
|
||||
nameToOperationConventionOrigin[symbol.callableId.callableName]
|
||||
source?.kind is FirFakeSourceElementKind.DesugaredComponentFunctionCall ->
|
||||
IrStatementOrigin.COMPONENT_N.withIndex(name.asString().removePrefix("component").toInt())
|
||||
else ->
|
||||
null
|
||||
}
|
||||
|
||||
+2
-1
@@ -20,6 +20,7 @@ import org.jetbrains.kotlin.fir.declarations.utils.*
|
||||
import org.jetbrains.kotlin.fir.descriptors.FirBuiltInsPackageFragment
|
||||
import org.jetbrains.kotlin.fir.descriptors.FirModuleDescriptor
|
||||
import org.jetbrains.kotlin.fir.descriptors.FirPackageFragmentDescriptor
|
||||
import org.jetbrains.kotlin.fir.expressions.FirComponentCall
|
||||
import org.jetbrains.kotlin.fir.expressions.FirConstExpression
|
||||
import org.jetbrains.kotlin.fir.expressions.FirExpression
|
||||
import org.jetbrains.kotlin.fir.expressions.FirQualifiedAccess
|
||||
@@ -986,7 +987,7 @@ class Fir2IrDeclarationStorage(
|
||||
irParent: IrDeclarationParent,
|
||||
givenOrigin: IrDeclarationOrigin? = null
|
||||
): IrVariable = convertCatching(variable) {
|
||||
val type = variable.returnTypeRef.toIrType()
|
||||
val type = ((variable.initializer as? FirComponentCall)?.typeRef ?: variable.returnTypeRef).toIrType()
|
||||
// Some temporary variables are produced in RawFirBuilder, but we consistently use special names for them.
|
||||
val origin = when {
|
||||
givenOrigin != null -> givenOrigin
|
||||
|
||||
@@ -275,7 +275,16 @@ class Fir2IrVisitor(
|
||||
initializer.resolvedNamedFunctionSymbol()?.callableId?.isIteratorNext() == true &&
|
||||
variable.source.psi?.parent is KtForExpression
|
||||
val irVariable = declarationStorage.createIrVariable(
|
||||
variable, conversionScope.parentFromStack(), if (isNextVariable) IrDeclarationOrigin.FOR_LOOP_VARIABLE else null
|
||||
variable, conversionScope.parentFromStack(),
|
||||
if (isNextVariable) {
|
||||
if (variable.name.isSpecial && variable.name == SpecialNames.DESTRUCT) {
|
||||
IrDeclarationOrigin.IR_TEMPORARY_VARIABLE
|
||||
} else {
|
||||
IrDeclarationOrigin.FOR_LOOP_VARIABLE
|
||||
}
|
||||
} else {
|
||||
null
|
||||
}
|
||||
)
|
||||
if (initializer != null) {
|
||||
irVariable.initializer =
|
||||
@@ -817,14 +826,27 @@ class Fir2IrVisitor(
|
||||
*/
|
||||
firLoopBody.convertWithOffsets { innerStartOffset, innerEndOffset ->
|
||||
val loopBodyStatements = firLoopBody.statements
|
||||
val firstStatement = loopBodyStatements.first().toIrStatement()
|
||||
?: error("Unexpected shape of body of for loop")
|
||||
if (loopBodyStatements.isEmpty()) {
|
||||
error("Unexpected shape of body of for loop")
|
||||
}
|
||||
val loopVariables = mutableListOf<IrStatement>()
|
||||
var loopVariableIndex = 0
|
||||
for (loopBodyStatement in loopBodyStatements) {
|
||||
if (loopVariableIndex > 0) {
|
||||
if (loopBodyStatement !is FirProperty || loopBodyStatement.initializer !is FirComponentCall) {
|
||||
break
|
||||
}
|
||||
}
|
||||
loopBodyStatement.toIrStatement()?.let { loopVariables.add(it) }
|
||||
loopVariableIndex++
|
||||
}
|
||||
|
||||
IrBlockImpl(
|
||||
innerStartOffset,
|
||||
innerEndOffset,
|
||||
irBuiltIns.unitType,
|
||||
origin,
|
||||
listOf(firstStatement) + loopBodyStatements.drop(1).convertToIrExpressionOrBlock(firLoopBody.source)
|
||||
loopVariables + loopBodyStatements.drop(loopVariableIndex).convertToIrExpressionOrBlock(firLoopBody.source)
|
||||
)
|
||||
}
|
||||
} else {
|
||||
|
||||
-2
@@ -1,5 +1,3 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
// IMPORTANT!
|
||||
// Please, when your changes cause failures in bytecodeText tests for 'for' loops,
|
||||
// examine the resulting bytecode shape carefully.
|
||||
|
||||
Vendored
-2
@@ -1,5 +1,3 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
// IMPORTANT!
|
||||
// Please, when your changes cause failures in bytecodeText tests for 'for' loops,
|
||||
// examine the resulting bytecode shape carefully.
|
||||
|
||||
Vendored
-2
@@ -1,5 +1,3 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
// IMPORTANT!
|
||||
// Please, when your changes cause failures in bytecodeText tests for 'for' loops,
|
||||
// examine the resulting bytecode shape carefully.
|
||||
|
||||
Vendored
-2
@@ -1,5 +1,3 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
// IMPORTANT!
|
||||
// Please, when your changes cause failures in bytecodeText tests for 'for' loops,
|
||||
// examine the resulting bytecode shape carefully.
|
||||
|
||||
Vendored
-2
@@ -1,5 +1,3 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
// IMPORTANT!
|
||||
// Please, when your changes cause failures in bytecodeText tests for 'for' loops,
|
||||
// examine the resulting bytecode shape carefully.
|
||||
|
||||
-2
@@ -1,5 +1,3 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
// IMPORTANT!
|
||||
// Please, when your changes cause failures in bytecodeText tests for 'for' loops,
|
||||
// examine the resulting bytecode shape carefully.
|
||||
|
||||
-2
@@ -1,5 +1,3 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
// IMPORTANT!
|
||||
// Please, when your changes cause failures in bytecodeText tests for 'for' loops,
|
||||
// examine the resulting bytecode shape carefully.
|
||||
|
||||
Vendored
-2
@@ -1,5 +1,3 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
// IMPORTANT!
|
||||
// Please, when your changes cause failures in bytecodeText tests for 'for' loops,
|
||||
// examine the resulting bytecode shape carefully.
|
||||
|
||||
-2
@@ -1,5 +1,3 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
// IMPORTANT!
|
||||
// Please, when your changes cause failures in bytecodeText tests for 'for' loops,
|
||||
// examine the resulting bytecode shape carefully.
|
||||
|
||||
-2
@@ -1,5 +1,3 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
// IMPORTANT!
|
||||
// Please, when your changes cause failures in bytecodeText tests for 'for' loops,
|
||||
// examine the resulting bytecode shape carefully.
|
||||
|
||||
-2
@@ -1,5 +1,3 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
// IMPORTANT!
|
||||
// Please, when your changes cause failures in bytecodeText tests for 'for' loops,
|
||||
// examine the resulting bytecode shape carefully.
|
||||
|
||||
Vendored
-2
@@ -1,5 +1,3 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
// IMPORTANT!
|
||||
// Please, when your changes cause failures in bytecodeText tests for 'for' loops,
|
||||
// examine the resulting bytecode shape carefully.
|
||||
|
||||
-2
@@ -1,5 +1,3 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
// IMPORTANT!
|
||||
// Please, when your changes cause failures in bytecodeText tests for 'for' loops,
|
||||
// examine the resulting bytecode shape carefully.
|
||||
|
||||
Vendored
-2
@@ -1,5 +1,3 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
// IMPORTANT!
|
||||
// Please, when your changes cause failures in bytecodeText tests for 'for' loops,
|
||||
// examine the resulting bytecode shape carefully.
|
||||
|
||||
-2
@@ -1,5 +1,3 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
// IMPORTANT!
|
||||
// Please, when your changes cause failures in bytecodeText tests for 'for' loops,
|
||||
// examine the resulting bytecode shape carefully.
|
||||
|
||||
-2
@@ -1,5 +1,3 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
// IMPORTANT!
|
||||
// Please, when your changes cause failures in bytecodeText tests for 'for' loops,
|
||||
// examine the resulting bytecode shape carefully.
|
||||
|
||||
-2
@@ -1,5 +1,3 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
// IMPORTANT!
|
||||
// Please, when your changes cause failures in bytecodeText tests for 'for' loops,
|
||||
// examine the resulting bytecode shape carefully.
|
||||
|
||||
Vendored
-2
@@ -1,5 +1,3 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
// IMPORTANT!
|
||||
// Please, when your changes cause failures in bytecodeText tests for 'for' loops,
|
||||
// examine the resulting bytecode shape carefully.
|
||||
|
||||
Vendored
-2
@@ -1,5 +1,3 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
// IMPORTANT!
|
||||
// Please, when your changes cause failures in bytecodeText tests for 'for' loops,
|
||||
// examine the resulting bytecode shape carefully.
|
||||
|
||||
Vendored
-2
@@ -1,5 +1,3 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
// IMPORTANT!
|
||||
// Please, when your changes cause failures in bytecodeText tests for 'for' loops,
|
||||
// examine the resulting bytecode shape carefully.
|
||||
|
||||
-2
@@ -1,5 +1,3 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
// IMPORTANT!
|
||||
// Please, when your changes cause failures in bytecodeText tests for 'for' loops,
|
||||
// examine the resulting bytecode shape carefully.
|
||||
|
||||
Vendored
-2
@@ -1,5 +1,3 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
// IMPORTANT!
|
||||
// Please, when your changes cause failures in bytecodeText tests for 'for' loops,
|
||||
// examine the resulting bytecode shape carefully.
|
||||
|
||||
-2
@@ -1,5 +1,3 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
// IMPORTANT!
|
||||
// Please, when your changes cause failures in bytecodeText tests for 'for' loops,
|
||||
// examine the resulting bytecode shape carefully.
|
||||
|
||||
Vendored
-2
@@ -1,5 +1,3 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
// IMPORTANT!
|
||||
// Please, when your changes cause failures in bytecodeText tests for 'for' loops,
|
||||
// examine the resulting bytecode shape carefully.
|
||||
|
||||
Vendored
-2
@@ -1,5 +1,3 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
// IMPORTANT!
|
||||
// Please, when your changes cause failures in bytecodeText tests for 'for' loops,
|
||||
// examine the resulting bytecode shape carefully.
|
||||
|
||||
-2
@@ -1,5 +1,3 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
// IMPORTANT!
|
||||
// Please, when your changes cause failures in bytecodeText tests for 'for' loops,
|
||||
// examine the resulting bytecode shape carefully.
|
||||
|
||||
Vendored
-2
@@ -1,5 +1,3 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
// IMPORTANT!
|
||||
// Please, when your changes cause failures in bytecodeText tests for 'for' loops,
|
||||
// examine the resulting bytecode shape carefully.
|
||||
|
||||
compiler/testData/codegen/bytecodeText/forLoop/forInSequenceWithIndex/forInEmptySequenceWithIndex.kt
Vendored
-2
@@ -1,5 +1,3 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
// IMPORTANT!
|
||||
// Please, when your changes cause failures in bytecodeText tests for 'for' loops,
|
||||
// examine the resulting bytecode shape carefully.
|
||||
|
||||
-2
@@ -1,5 +1,3 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
// IMPORTANT!
|
||||
// Please, when your changes cause failures in bytecodeText tests for 'for' loops,
|
||||
// examine the resulting bytecode shape carefully.
|
||||
|
||||
Vendored
-2
@@ -1,5 +1,3 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
// IMPORTANT!
|
||||
// Please, when your changes cause failures in bytecodeText tests for 'for' loops,
|
||||
// examine the resulting bytecode shape carefully.
|
||||
|
||||
-2
@@ -1,5 +1,3 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
// IMPORTANT!
|
||||
// Please, when your changes cause failures in bytecodeText tests for 'for' loops,
|
||||
// examine the resulting bytecode shape carefully.
|
||||
|
||||
-2
@@ -1,5 +1,3 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
// IMPORTANT!
|
||||
// Please, when your changes cause failures in bytecodeText tests for 'for' loops,
|
||||
// examine the resulting bytecode shape carefully.
|
||||
|
||||
-1
@@ -1,4 +1,3 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
// FULL_JDK
|
||||
|
||||
// IMPORTANT!
|
||||
|
||||
-2
@@ -1,5 +1,3 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
// IMPORTANT!
|
||||
// Please, when your changes cause failures in bytecodeText tests for 'for' loops,
|
||||
// examine the resulting bytecode shape carefully.
|
||||
|
||||
-1
@@ -1,5 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
// IMPORTANT!
|
||||
// Please, when your changes cause failures in bytecodeText tests for 'for' loops,
|
||||
|
||||
@@ -67,6 +67,7 @@ FILE fqName:<root> fileName:/breakContinueInLoopHeader.kt
|
||||
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<kotlin.String> [val] declared in <root>.test3' type=kotlin.collections.Iterator<kotlin.String> origin=null
|
||||
BLOCK type=kotlin.Unit origin=null
|
||||
FUN name:test4 visibility:public modality:FINAL <> (ss:kotlin.collections.List<kotlin.String>?) returnType:kotlin.Unit
|
||||
VALUE_PARAMETER name:ss index:0 type:kotlin.collections.List<kotlin.String>?
|
||||
BLOCK_BODY
|
||||
@@ -95,6 +96,7 @@ FILE fqName:<root> fileName:/breakContinueInLoopHeader.kt
|
||||
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<kotlin.String> [val] declared in <root>.test4' type=kotlin.collections.Iterator<kotlin.String> origin=null
|
||||
BLOCK type=kotlin.Unit origin=null
|
||||
FUN name:test5 visibility:public modality:FINAL <> () returnType:kotlin.Unit
|
||||
BLOCK_BODY
|
||||
VAR name:i type:kotlin.Int [var]
|
||||
|
||||
@@ -36,6 +36,8 @@ fun test3(ss: List<String>?) {
|
||||
}.iterator()
|
||||
L2@ while (<iterator>.hasNext()) { // BLOCK
|
||||
val s: String = <iterator>.next()
|
||||
{ // BLOCK
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -53,6 +55,8 @@ fun test4(ss: List<String>?) {
|
||||
}.iterator()
|
||||
L2@ while (<iterator>.hasNext()) { // BLOCK
|
||||
val s: String = <iterator>.next()
|
||||
{ // BLOCK
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -78,3 +82,4 @@ fun test5() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -55,10 +55,10 @@ FILE fqName:<root> fileName:/destructuring1.kt
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:<root>.A [val]
|
||||
GET_OBJECT 'CLASS OBJECT name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' type=<root>.A
|
||||
VAR name:x type:kotlin.Int [val]
|
||||
CALL 'public final fun component1 (): kotlin.Int [operator] declared in <root>.B' type=kotlin.Int origin=null
|
||||
CALL 'public final fun component1 (): kotlin.Int [operator] declared in <root>.B' type=kotlin.Int origin=COMPONENT_N(index=1)
|
||||
$this: GET_VAR '<this>: <root>.B declared in <root>.test' type=<root>.B origin=null
|
||||
$receiver: GET_VAR 'val tmp_0: <root>.A [val] declared in <root>.test' type=<root>.A origin=null
|
||||
VAR name:y type:kotlin.Int [val]
|
||||
CALL 'public final fun component2 (): kotlin.Int [operator] declared in <root>.B' type=kotlin.Int origin=null
|
||||
CALL 'public final fun component2 (): kotlin.Int [operator] declared in <root>.B' type=kotlin.Int origin=COMPONENT_N(index=2)
|
||||
$this: GET_VAR '<this>: <root>.B declared in <root>.test' type=<root>.B origin=null
|
||||
$receiver: GET_VAR 'val tmp_0: <root>.A [val] declared in <root>.test' type=<root>.A origin=null
|
||||
|
||||
+2
-2
@@ -61,10 +61,10 @@ FILE fqName:<root> fileName:/destructuringWithUnderscore.kt
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:<root>.A [val]
|
||||
GET_OBJECT 'CLASS OBJECT name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' type=<root>.A
|
||||
VAR name:x type:kotlin.Int [val]
|
||||
CALL 'public final fun component1 (): kotlin.Int [operator] declared in <root>.B' type=kotlin.Int origin=null
|
||||
CALL 'public final fun component1 (): kotlin.Int [operator] declared in <root>.B' type=kotlin.Int origin=COMPONENT_N(index=1)
|
||||
$this: GET_VAR '<this>: <root>.B declared in <root>.test' type=<root>.B origin=null
|
||||
$receiver: GET_VAR 'val tmp_0: <root>.A [val] declared in <root>.test' type=<root>.A origin=null
|
||||
VAR name:z type:kotlin.Int [val]
|
||||
CALL 'public final fun component3 (): kotlin.Int [operator] declared in <root>.B' type=kotlin.Int origin=null
|
||||
CALL 'public final fun component3 (): kotlin.Int [operator] declared in <root>.B' type=kotlin.Int origin=COMPONENT_N(index=3)
|
||||
$this: GET_VAR '<this>: <root>.B declared in <root>.test' type=<root>.B origin=null
|
||||
$receiver: GET_VAR 'val tmp_0: <root>.A [val] declared in <root>.test' type=<root>.A origin=null
|
||||
|
||||
+12
-10
@@ -13,6 +13,7 @@ FILE fqName:<root> fileName:/for.kt
|
||||
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<kotlin.String> [val] declared in <root>.testEmpty' type=kotlin.collections.Iterator<kotlin.String> origin=null
|
||||
BLOCK type=kotlin.Unit origin=null
|
||||
FUN name:testIterable visibility:public modality:FINAL <> (ss:kotlin.collections.List<kotlin.String>) returnType:kotlin.Unit
|
||||
VALUE_PARAMETER name:ss index:0 type:kotlin.collections.List<kotlin.String>
|
||||
BLOCK_BODY
|
||||
@@ -40,16 +41,16 @@ FILE fqName:<root> fileName:/for.kt
|
||||
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.Pair<kotlin.Int, kotlin.String>> [val] declared in <root>.testDestructuring' type=kotlin.collections.Iterator<kotlin.Pair<kotlin.Int, kotlin.String>> origin=null
|
||||
body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE
|
||||
VAR FOR_LOOP_VARIABLE name:<destruct> type:kotlin.Pair<kotlin.Int, kotlin.String> [val]
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_3 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
|
||||
$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
|
||||
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=COMPONENT_N(index=1)
|
||||
$this: GET_VAR 'val tmp_3: kotlin.Pair<kotlin.Int, kotlin.String> [val] declared in <root>.testDestructuring' type=kotlin.Pair<kotlin.Int, kotlin.String> origin=null
|
||||
VAR name:s type:kotlin.String [val]
|
||||
CALL 'public final fun component2 (): B of kotlin.Pair [operator] declared in kotlin.Pair' type=kotlin.String origin=COMPONENT_N(index=2)
|
||||
$this: GET_VAR 'val tmp_3: kotlin.Pair<kotlin.Int, kotlin.String> [val] declared in <root>.testDestructuring' type=kotlin.Pair<kotlin.Int, kotlin.String> origin=null
|
||||
BLOCK type=kotlin.Unit origin=null
|
||||
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
|
||||
$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
|
||||
VAR name:s type:kotlin.String [val]
|
||||
CALL 'public final fun component2 (): B of kotlin.Pair [operator] declared in kotlin.Pair' type=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
|
||||
CALL 'public final fun println (message: kotlin.Int): kotlin.Unit [inline] declared in kotlin.io.ConsoleKt' type=kotlin.Unit origin=null
|
||||
message: GET_VAR 'val i: kotlin.Int [val] declared in <root>.testDestructuring' type=kotlin.Int origin=null
|
||||
CALL 'public final fun println (message: kotlin.Any?): kotlin.Unit [inline] declared in kotlin.io.ConsoleKt' type=kotlin.Unit origin=null
|
||||
@@ -57,15 +58,16 @@ FILE fqName:<root> fileName:/for.kt
|
||||
FUN name:testRange visibility:public modality:FINAL <> () returnType:kotlin.Unit
|
||||
BLOCK_BODY
|
||||
BLOCK type=kotlin.Unit origin=FOR_LOOP
|
||||
VAR FOR_LOOP_ITERATOR name:tmp_3 type:kotlin.collections.IntIterator [val]
|
||||
VAR FOR_LOOP_ITERATOR name:tmp_4 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=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 [fake_override,operator] declared in kotlin.collections.IntIterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT
|
||||
$this: GET_VAR 'val tmp_3: kotlin.collections.IntIterator [val] declared in <root>.testRange' type=kotlin.collections.IntIterator origin=null
|
||||
$this: GET_VAR 'val tmp_4: kotlin.collections.IntIterator [val] declared in <root>.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 <root>.testRange' type=kotlin.collections.IntIterator origin=null
|
||||
$this: GET_VAR 'val tmp_4: kotlin.collections.IntIterator [val] declared in <root>.testRange' type=kotlin.collections.IntIterator origin=null
|
||||
BLOCK type=kotlin.Unit origin=null
|
||||
|
||||
+7
-2
@@ -3,6 +3,8 @@ fun testEmpty(ss: List<String>) {
|
||||
val <iterator>: Iterator<String> = ss.iterator()
|
||||
while (<iterator>.hasNext()) { // BLOCK
|
||||
val s: String = <iterator>.next()
|
||||
{ // BLOCK
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -22,9 +24,9 @@ fun testDestructuring(pp: List<Pair<Int, String>>) {
|
||||
val <iterator>: Iterator<Pair<Int, String>> = pp.iterator()
|
||||
while (<iterator>.hasNext()) { // BLOCK
|
||||
val <destruct>: Pair<Int, String> = <iterator>.next()
|
||||
val i: Int = <destruct>.component1()
|
||||
val s: String = <destruct>.component2()
|
||||
{ // BLOCK
|
||||
val i: Int = <destruct>.component1()
|
||||
val s: String = <destruct>.component2()
|
||||
println(message = i)
|
||||
println(message = s)
|
||||
}
|
||||
@@ -37,6 +39,9 @@ fun testRange() {
|
||||
val <iterator>: IntIterator = 1.rangeTo(other = 10).iterator()
|
||||
while (<iterator>.hasNext()) { // BLOCK
|
||||
val i: Int = <iterator>.next()
|
||||
{ // BLOCK
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Vendored
+2
-2
@@ -14,9 +14,9 @@ FILE fqName:<root> fileName:/implicitNotNullInDestructuringAssignment.kt
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:@[FlexibleNullability] <root>.J? [val]
|
||||
CALL 'public open fun j (): @[FlexibleNullability] <root>.J? declared in <root>.J' type=@[FlexibleNullability] <root>.J? origin=null
|
||||
VAR name:a type:kotlin.Int [val]
|
||||
CALL 'public final fun component1 (): kotlin.Int [operator] declared in <root>' type=kotlin.Int origin=null
|
||||
CALL 'public final fun component1 (): kotlin.Int [operator] declared in <root>' type=kotlin.Int origin=COMPONENT_N(index=1)
|
||||
$receiver: GET_VAR 'val tmp_0: @[FlexibleNullability] <root>.J? [val] declared in <root>.test' type=@[FlexibleNullability] <root>.J? origin=null
|
||||
VAR name:b type:kotlin.Int [val]
|
||||
CALL 'private final fun component2 (): kotlin.Int [operator] declared in <root>' type=kotlin.Int origin=null
|
||||
CALL 'private final fun component2 (): kotlin.Int [operator] declared in <root>' type=kotlin.Int origin=COMPONENT_N(index=2)
|
||||
$receiver: TYPE_OP type=@[FlexibleNullability] <root>.J origin=IMPLICIT_NOTNULL typeOperand=@[FlexibleNullability] <root>.J
|
||||
GET_VAR 'val tmp_0: @[FlexibleNullability] <root>.J? [val] declared in <root>.test' type=@[FlexibleNullability] <root>.J? origin=null
|
||||
|
||||
@@ -53,11 +53,11 @@ FILE fqName:<root> fileName:/multipleSmartCasts.kt
|
||||
TYPE_OP type=<root>.IC1 origin=IMPLICIT_CAST typeOperand=<root>.IC1
|
||||
GET_VAR 'x: kotlin.Any declared in <root>.test' type=kotlin.Any origin=null
|
||||
VAR name:x1 type:kotlin.Int [val]
|
||||
CALL 'public abstract fun component1 (): kotlin.Int [operator] declared in <root>.IC1' type=kotlin.Int origin=null
|
||||
CALL 'public abstract fun component1 (): kotlin.Int [operator] declared in <root>.IC1' type=kotlin.Int origin=COMPONENT_N(index=1)
|
||||
$this: TYPE_OP type=<root>.IC1 origin=IMPLICIT_CAST typeOperand=<root>.IC1
|
||||
GET_VAR 'val tmp_0: kotlin.Any [val] declared in <root>.test' type=kotlin.Any origin=null
|
||||
VAR name:x2 type:kotlin.String [val]
|
||||
CALL 'public abstract fun component2 (): kotlin.String [operator] declared in <root>.IC2' type=kotlin.String origin=null
|
||||
CALL 'public abstract fun component2 (): kotlin.String [operator] declared in <root>.IC2' type=kotlin.String origin=COMPONENT_N(index=2)
|
||||
$this: TYPE_OP type=<root>.IC2 origin=IMPLICIT_CAST typeOperand=<root>.IC2
|
||||
TYPE_OP type=<root>.IC1 origin=IMPLICIT_CAST typeOperand=<root>.IC1
|
||||
GET_VAR 'val tmp_0: kotlin.Any [val] declared in <root>.test' type=kotlin.Any origin=null
|
||||
|
||||
+2
-2
@@ -52,10 +52,10 @@ FILE fqName:<root> fileName:/smartCastsWithDestructuring.kt
|
||||
TYPE_OP type=<root>.I2 origin=IMPLICIT_CAST typeOperand=<root>.I2
|
||||
GET_VAR 'x: <root>.I1 declared in <root>.test' type=<root>.I1 origin=null
|
||||
VAR name:c1 type:kotlin.Int [val]
|
||||
CALL 'public final fun component1 (): kotlin.Int [operator] declared in <root>' type=kotlin.Int origin=null
|
||||
CALL 'public final fun component1 (): kotlin.Int [operator] declared in <root>' type=kotlin.Int origin=COMPONENT_N(index=1)
|
||||
$receiver: TYPE_OP type=<root>.I2 origin=IMPLICIT_CAST typeOperand=<root>.I2
|
||||
GET_VAR 'val tmp_0: <root>.I1 [val] declared in <root>.test' type=<root>.I1 origin=null
|
||||
VAR name:c2 type:kotlin.String [val]
|
||||
CALL 'public final fun component2 (): kotlin.String [operator] declared in <root>' type=kotlin.String origin=null
|
||||
CALL 'public final fun component2 (): kotlin.String [operator] declared in <root>' type=kotlin.String origin=COMPONENT_N(index=2)
|
||||
$receiver: TYPE_OP type=<root>.I2 origin=IMPLICIT_CAST typeOperand=<root>.I2
|
||||
GET_VAR 'val tmp_0: <root>.I1 [val] declared in <root>.test' type=<root>.I1 origin=null
|
||||
|
||||
@@ -178,33 +178,32 @@ FILE fqName:<root> fileName:/DeepCopyIrTree.kt
|
||||
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
|
||||
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 IR_TEMPORARY_VARIABLE name:tmp_1 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
|
||||
$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]
|
||||
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
|
||||
VAR name:otherTypeParameter type:<root>.IrTypeParameter [val]
|
||||
CALL 'public final fun component2 (): B 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
|
||||
CALL 'public final fun mapTo <T, R, C> (destination: C of kotlin.collections.CollectionsKt.mapTo, transform: kotlin.Function1<T of kotlin.collections.CollectionsKt.mapTo, R of kotlin.collections.CollectionsKt.mapTo>): C of kotlin.collections.CollectionsKt.mapTo [inline] declared in kotlin.collections.CollectionsKt' type=kotlin.collections.MutableList<<root>.IrType> origin=null
|
||||
<T>: <root>.IrType
|
||||
<R>: <root>.IrType
|
||||
<C>: kotlin.collections.MutableList<<root>.IrType>
|
||||
$receiver: CALL 'public abstract fun <get-superTypes> (): kotlin.collections.MutableList<<root>.IrType> declared in <root>.IrTypeParameter' type=kotlin.collections.MutableList<<root>.IrType> origin=GET_PROPERTY
|
||||
$this: GET_VAR 'val otherTypeParameter: <root>.IrTypeParameter [val] declared in <root>.DeepCopyIrTreeWithSymbols.copyTypeParametersFrom.<anonymous>' type=<root>.IrTypeParameter origin=null
|
||||
destination: CALL 'public abstract fun <get-superTypes> (): kotlin.collections.MutableList<<root>.IrType> declared in <root>.IrTypeParameter' type=kotlin.collections.MutableList<<root>.IrType> origin=GET_PROPERTY
|
||||
$this: GET_VAR 'val thisTypeParameter: <root>.IrTypeParameter [val] declared in <root>.DeepCopyIrTreeWithSymbols.copyTypeParametersFrom.<anonymous>' type=<root>.IrTypeParameter origin=null
|
||||
transform: FUN_EXPR type=kotlin.Function1<<root>.IrType, <root>.IrType> origin=LAMBDA
|
||||
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> (it:<root>.IrType) returnType:<root>.IrType
|
||||
VALUE_PARAMETER name:it index:0 type:<root>.IrType
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='local final fun <anonymous> (it: <root>.IrType): <root>.IrType declared in <root>.DeepCopyIrTreeWithSymbols.copyTypeParametersFrom.<anonymous>'
|
||||
CALL 'public abstract fun remapType (type: <root>.IrType): <root>.IrType declared in <root>.TypeRemapper' type=<root>.IrType origin=null
|
||||
$this: CALL 'private final fun <get-typeRemapper> (): <root>.TypeRemapper declared in <root>.DeepCopyIrTreeWithSymbols' type=<root>.TypeRemapper origin=GET_PROPERTY
|
||||
$this: GET_VAR '<this>: <root>.DeepCopyIrTreeWithSymbols declared in <root>.DeepCopyIrTreeWithSymbols.copyTypeParametersFrom' type=<root>.DeepCopyIrTreeWithSymbols origin=null
|
||||
type: GET_VAR 'it: <root>.IrType declared in <root>.DeepCopyIrTreeWithSymbols.copyTypeParametersFrom.<anonymous>.<anonymous>' type=<root>.IrType origin=null
|
||||
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=COMPONENT_N(index=1)
|
||||
$this: GET_VAR 'val tmp_1: kotlin.Pair<<root>.IrTypeParameter, <root>.IrTypeParameter> [val] declared in <root>.DeepCopyIrTreeWithSymbols.copyTypeParametersFrom.<anonymous>' type=kotlin.Pair<<root>.IrTypeParameter, <root>.IrTypeParameter> origin=null
|
||||
VAR name:otherTypeParameter type:<root>.IrTypeParameter [val]
|
||||
CALL 'public final fun component2 (): B of kotlin.Pair [operator] declared in kotlin.Pair' type=<root>.IrTypeParameter origin=COMPONENT_N(index=2)
|
||||
$this: GET_VAR 'val tmp_1: kotlin.Pair<<root>.IrTypeParameter, <root>.IrTypeParameter> [val] declared in <root>.DeepCopyIrTreeWithSymbols.copyTypeParametersFrom.<anonymous>' type=kotlin.Pair<<root>.IrTypeParameter, <root>.IrTypeParameter> origin=null
|
||||
CALL 'public final fun mapTo <T, R, C> (destination: C of kotlin.collections.CollectionsKt.mapTo, transform: kotlin.Function1<T of kotlin.collections.CollectionsKt.mapTo, R of kotlin.collections.CollectionsKt.mapTo>): C of kotlin.collections.CollectionsKt.mapTo [inline] declared in kotlin.collections.CollectionsKt' type=kotlin.collections.MutableList<<root>.IrType> origin=null
|
||||
<T>: <root>.IrType
|
||||
<R>: <root>.IrType
|
||||
<C>: kotlin.collections.MutableList<<root>.IrType>
|
||||
$receiver: CALL 'public abstract fun <get-superTypes> (): kotlin.collections.MutableList<<root>.IrType> declared in <root>.IrTypeParameter' type=kotlin.collections.MutableList<<root>.IrType> origin=GET_PROPERTY
|
||||
$this: GET_VAR 'val otherTypeParameter: <root>.IrTypeParameter [val] declared in <root>.DeepCopyIrTreeWithSymbols.copyTypeParametersFrom.<anonymous>' type=<root>.IrTypeParameter origin=null
|
||||
destination: CALL 'public abstract fun <get-superTypes> (): kotlin.collections.MutableList<<root>.IrType> declared in <root>.IrTypeParameter' type=kotlin.collections.MutableList<<root>.IrType> origin=GET_PROPERTY
|
||||
$this: GET_VAR 'val thisTypeParameter: <root>.IrTypeParameter [val] declared in <root>.DeepCopyIrTreeWithSymbols.copyTypeParametersFrom.<anonymous>' type=<root>.IrTypeParameter origin=null
|
||||
transform: FUN_EXPR type=kotlin.Function1<<root>.IrType, <root>.IrType> origin=LAMBDA
|
||||
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> (it:<root>.IrType) returnType:<root>.IrType
|
||||
VALUE_PARAMETER name:it index:0 type:<root>.IrType
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='local final fun <anonymous> (it: <root>.IrType): <root>.IrType declared in <root>.DeepCopyIrTreeWithSymbols.copyTypeParametersFrom.<anonymous>'
|
||||
CALL 'public abstract fun remapType (type: <root>.IrType): <root>.IrType declared in <root>.TypeRemapper' type=<root>.IrType origin=null
|
||||
$this: CALL 'private final fun <get-typeRemapper> (): <root>.TypeRemapper declared in <root>.DeepCopyIrTreeWithSymbols' type=<root>.TypeRemapper origin=GET_PROPERTY
|
||||
$this: GET_VAR '<this>: <root>.DeepCopyIrTreeWithSymbols declared in <root>.DeepCopyIrTreeWithSymbols.copyTypeParametersFrom' type=<root>.DeepCopyIrTreeWithSymbols origin=null
|
||||
type: GET_VAR 'it: <root>.IrType declared in <root>.DeepCopyIrTreeWithSymbols.copyTypeParametersFrom.<anonymous>.<anonymous>' type=<root>.IrType origin=null
|
||||
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
|
||||
overridden:
|
||||
public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any
|
||||
|
||||
@@ -55,14 +55,12 @@ class DeepCopyIrTreeWithSymbols {
|
||||
val <iterator>: Iterator<Pair<IrTypeParameter, IrTypeParameter>> = <this>.<get-typeParameters>().zip<IrTypeParameter, IrTypeParameter>(other = other.<get-typeParameters>()).iterator()
|
||||
while (<iterator>.hasNext()) { // BLOCK
|
||||
val <destruct>: Pair<IrTypeParameter, IrTypeParameter> = <iterator>.next()
|
||||
{ // BLOCK
|
||||
val thisTypeParameter: IrTypeParameter = <destruct>.component1()
|
||||
val otherTypeParameter: IrTypeParameter = <destruct>.component2()
|
||||
otherTypeParameter.<get-superTypes>().mapTo<IrType, IrType, MutableList<IrType>>(destination = thisTypeParameter.<get-superTypes>(), transform = local fun <anonymous>(it: IrType): IrType {
|
||||
return <this>.<get-typeRemapper>().remapType(type = it)
|
||||
}
|
||||
)
|
||||
val thisTypeParameter: IrTypeParameter = <destruct>.component1()
|
||||
val otherTypeParameter: IrTypeParameter = <destruct>.component2()
|
||||
otherTypeParameter.<get-superTypes>().mapTo<IrType, IrType, MutableList<IrType>>(destination = thisTypeParameter.<get-superTypes>(), transform = local fun <anonymous>(it: IrType): IrType {
|
||||
return <this>.<get-typeRemapper>().remapType(type = it)
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -77,3 +75,4 @@ inline fun <T : Any?> TypeRemapper.withinScope(irTypeParametersContainer: IrType
|
||||
<this>.leaveScope()
|
||||
return result
|
||||
}
|
||||
|
||||
|
||||
@@ -143,7 +143,7 @@ FILE fqName:<root> fileName:/destructuringInLambda.kt
|
||||
VALUE_PARAMETER name:<destruct> index:0 type:<root>.A
|
||||
BLOCK_BODY
|
||||
VAR name:y type:kotlin.Int [val]
|
||||
CALL 'public final fun component2 (): kotlin.Int [operator] declared in <root>.A' type=kotlin.Int origin=null
|
||||
CALL 'public final fun component2 (): kotlin.Int [operator] declared in <root>.A' type=kotlin.Int origin=COMPONENT_N(index=2)
|
||||
$this: GET_VAR '<destruct>: <root>.A declared in <root>.fn.<anonymous>' type=<root>.A origin=null
|
||||
RETURN type=kotlin.Nothing from='local final fun <anonymous> (<destruct>: <root>.A): kotlin.Int declared in <root>.fn'
|
||||
CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=PLUS
|
||||
|
||||
compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInDestructuringAssignment.fir.ir.txt
Vendored
+18
-18
@@ -121,10 +121,10 @@ FILE fqName:<root> fileName:/enhancedNullabilityInDestructuringAssignment.kt
|
||||
TYPE_OP type=<root>.P origin=IMPLICIT_NOTNULL typeOperand=<root>.P
|
||||
CALL 'public open fun notNullP (): @[EnhancedNullability] <root>.P declared in <root>.J' type=@[EnhancedNullability] <root>.P origin=null
|
||||
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=COMPONENT_N(index=1)
|
||||
$this: GET_VAR 'val tmp_0: <root>.P [val] declared in <root>.test1' type=<root>.P origin=null
|
||||
VAR name:y type:kotlin.Int [val]
|
||||
CALL 'public final fun component2 (): kotlin.Int [operator] declared in <root>.P' type=kotlin.Int origin=null
|
||||
CALL 'public final fun component2 (): kotlin.Int [operator] declared in <root>.P' type=kotlin.Int origin=COMPONENT_N(index=2)
|
||||
$this: GET_VAR 'val tmp_0: <root>.P [val] declared in <root>.test1' type=<root>.P origin=null
|
||||
CALL 'public final fun use (x: kotlin.Any, y: kotlin.Any): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
|
||||
x: GET_VAR 'val x: kotlin.Int [val] declared in <root>.test1' type=kotlin.Int origin=null
|
||||
@@ -133,17 +133,17 @@ FILE fqName:<root> fileName:/enhancedNullabilityInDestructuringAssignment.kt
|
||||
BLOCK_BODY
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:@[FlexibleNullability] <root>.Q<@[EnhancedNullability] kotlin.String, @[EnhancedNullability] kotlin.String>? [val]
|
||||
CALL 'public open fun notNullComponents (): @[FlexibleNullability] <root>.Q<@[EnhancedNullability] kotlin.String, @[EnhancedNullability] kotlin.String>? declared in <root>.J' type=@[FlexibleNullability] <root>.Q<@[EnhancedNullability] kotlin.String, @[EnhancedNullability] kotlin.String>? origin=null
|
||||
VAR name:x type:kotlin.String [val]
|
||||
VAR name:x type:@[EnhancedNullability] kotlin.String [val]
|
||||
TYPE_OP type=kotlin.String origin=IMPLICIT_NOTNULL typeOperand=kotlin.String
|
||||
CALL 'public final fun component1 (): T1 of <root>.Q [operator] declared in <root>.Q' type=@[EnhancedNullability] kotlin.String origin=null
|
||||
CALL 'public final fun component1 (): T1 of <root>.Q [operator] declared in <root>.Q' type=@[EnhancedNullability] kotlin.String origin=COMPONENT_N(index=1)
|
||||
$this: GET_VAR 'val tmp_1: @[FlexibleNullability] <root>.Q<@[EnhancedNullability] kotlin.String, @[EnhancedNullability] kotlin.String>? [val] declared in <root>.test2' type=@[FlexibleNullability] <root>.Q<@[EnhancedNullability] kotlin.String, @[EnhancedNullability] kotlin.String>? origin=null
|
||||
VAR name:y type:kotlin.String [val]
|
||||
VAR name:y type:@[EnhancedNullability] kotlin.String [val]
|
||||
TYPE_OP type=kotlin.String origin=IMPLICIT_NOTNULL typeOperand=kotlin.String
|
||||
CALL 'public final fun component2 (): T2 of <root>.Q [operator] declared in <root>.Q' type=@[EnhancedNullability] kotlin.String origin=null
|
||||
CALL 'public final fun component2 (): T2 of <root>.Q [operator] declared in <root>.Q' type=@[EnhancedNullability] kotlin.String origin=COMPONENT_N(index=2)
|
||||
$this: GET_VAR 'val tmp_1: @[FlexibleNullability] <root>.Q<@[EnhancedNullability] kotlin.String, @[EnhancedNullability] kotlin.String>? [val] declared in <root>.test2' type=@[FlexibleNullability] <root>.Q<@[EnhancedNullability] kotlin.String, @[EnhancedNullability] kotlin.String>? origin=null
|
||||
CALL 'public final fun use (x: kotlin.Any, y: kotlin.Any): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
|
||||
x: GET_VAR 'val x: kotlin.String [val] declared in <root>.test2' type=kotlin.String origin=null
|
||||
y: GET_VAR 'val y: kotlin.String [val] declared in <root>.test2' type=kotlin.String origin=null
|
||||
x: GET_VAR 'val x: @[EnhancedNullability] kotlin.String [val] declared in <root>.test2' type=kotlin.String origin=null
|
||||
y: GET_VAR 'val y: @[EnhancedNullability] kotlin.String [val] declared in <root>.test2' type=kotlin.String origin=null
|
||||
FUN name:test2Desugared visibility:public modality:FINAL <> () returnType:kotlin.Unit
|
||||
BLOCK_BODY
|
||||
VAR name:tmp type:@[FlexibleNullability] <root>.Q<@[EnhancedNullability] kotlin.String, @[EnhancedNullability] kotlin.String>? [val]
|
||||
@@ -164,17 +164,17 @@ FILE fqName:<root> fileName:/enhancedNullabilityInDestructuringAssignment.kt
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:<root>.Q<@[EnhancedNullability] kotlin.String, @[EnhancedNullability] kotlin.String> [val]
|
||||
TYPE_OP type=<root>.Q<@[EnhancedNullability] kotlin.String, @[EnhancedNullability] kotlin.String> origin=IMPLICIT_NOTNULL typeOperand=<root>.Q<@[EnhancedNullability] kotlin.String, @[EnhancedNullability] kotlin.String>
|
||||
CALL 'public open fun notNullQAndComponents (): @[EnhancedNullability] <root>.Q<@[EnhancedNullability] kotlin.String, @[EnhancedNullability] kotlin.String> declared in <root>.J' type=@[EnhancedNullability] <root>.Q<@[EnhancedNullability] kotlin.String, @[EnhancedNullability] kotlin.String> origin=null
|
||||
VAR name:x type:kotlin.String [val]
|
||||
VAR name:x type:@[EnhancedNullability] kotlin.String [val]
|
||||
TYPE_OP type=kotlin.String origin=IMPLICIT_NOTNULL typeOperand=kotlin.String
|
||||
CALL 'public final fun component1 (): T1 of <root>.Q [operator] declared in <root>.Q' type=@[EnhancedNullability] kotlin.String origin=null
|
||||
CALL 'public final fun component1 (): T1 of <root>.Q [operator] declared in <root>.Q' type=@[EnhancedNullability] kotlin.String origin=COMPONENT_N(index=1)
|
||||
$this: GET_VAR 'val tmp_2: <root>.Q<@[EnhancedNullability] kotlin.String, @[EnhancedNullability] kotlin.String> [val] declared in <root>.test3' type=<root>.Q<@[EnhancedNullability] kotlin.String, @[EnhancedNullability] kotlin.String> origin=null
|
||||
VAR name:y type:kotlin.String [val]
|
||||
VAR name:y type:@[EnhancedNullability] kotlin.String [val]
|
||||
TYPE_OP type=kotlin.String origin=IMPLICIT_NOTNULL typeOperand=kotlin.String
|
||||
CALL 'public final fun component2 (): T2 of <root>.Q [operator] declared in <root>.Q' type=@[EnhancedNullability] kotlin.String origin=null
|
||||
CALL 'public final fun component2 (): T2 of <root>.Q [operator] declared in <root>.Q' type=@[EnhancedNullability] kotlin.String origin=COMPONENT_N(index=2)
|
||||
$this: GET_VAR 'val tmp_2: <root>.Q<@[EnhancedNullability] kotlin.String, @[EnhancedNullability] kotlin.String> [val] declared in <root>.test3' type=<root>.Q<@[EnhancedNullability] kotlin.String, @[EnhancedNullability] kotlin.String> origin=null
|
||||
CALL 'public final fun use (x: kotlin.Any, y: kotlin.Any): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
|
||||
x: GET_VAR 'val x: kotlin.String [val] declared in <root>.test3' type=kotlin.String origin=null
|
||||
y: GET_VAR 'val y: kotlin.String [val] declared in <root>.test3' type=kotlin.String origin=null
|
||||
x: GET_VAR 'val x: @[EnhancedNullability] kotlin.String [val] declared in <root>.test3' type=kotlin.String origin=null
|
||||
y: GET_VAR 'val y: @[EnhancedNullability] kotlin.String [val] declared in <root>.test3' type=kotlin.String origin=null
|
||||
FUN name:test4 visibility:public modality:FINAL <> () returnType:kotlin.Unit
|
||||
BLOCK_BODY
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:kotlin.collections.IndexedValue<@[EnhancedNullability] <root>.P> [val]
|
||||
@@ -185,12 +185,12 @@ FILE fqName:<root> fileName:/enhancedNullabilityInDestructuringAssignment.kt
|
||||
$receiver: TYPE_OP type=@[FlexibleNullability] kotlin.collections.List<@[EnhancedNullability] <root>.P> origin=IMPLICIT_NOTNULL typeOperand=@[FlexibleNullability] kotlin.collections.List<@[EnhancedNullability] <root>.P>
|
||||
CALL 'public open fun listOfNotNull (): @[FlexibleNullability] kotlin.collections.List<@[EnhancedNullability] <root>.P>? declared in <root>.J' type=@[FlexibleNullability] kotlin.collections.List<@[EnhancedNullability] <root>.P>? origin=null
|
||||
VAR name:x type:kotlin.Int [val]
|
||||
CALL 'public final fun component1 (): kotlin.Int [operator] declared in kotlin.collections.IndexedValue' type=kotlin.Int origin=null
|
||||
CALL 'public final fun component1 (): kotlin.Int [operator] declared in kotlin.collections.IndexedValue' type=kotlin.Int origin=COMPONENT_N(index=1)
|
||||
$this: GET_VAR 'val tmp_3: kotlin.collections.IndexedValue<@[EnhancedNullability] <root>.P> [val] declared in <root>.test4' type=kotlin.collections.IndexedValue<@[EnhancedNullability] <root>.P> origin=null
|
||||
VAR name:y type:<root>.P [val]
|
||||
VAR name:y type:@[EnhancedNullability] <root>.P [val]
|
||||
TYPE_OP type=<root>.P origin=IMPLICIT_NOTNULL typeOperand=<root>.P
|
||||
CALL 'public final fun component2 (): T of kotlin.collections.IndexedValue [operator] declared in kotlin.collections.IndexedValue' type=@[EnhancedNullability] <root>.P origin=null
|
||||
CALL 'public final fun component2 (): T of kotlin.collections.IndexedValue [operator] declared in kotlin.collections.IndexedValue' type=@[EnhancedNullability] <root>.P origin=COMPONENT_N(index=2)
|
||||
$this: GET_VAR 'val tmp_3: kotlin.collections.IndexedValue<@[EnhancedNullability] <root>.P> [val] declared in <root>.test4' type=kotlin.collections.IndexedValue<@[EnhancedNullability] <root>.P> origin=null
|
||||
CALL 'public final fun use (x: kotlin.Any, y: kotlin.Any): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
|
||||
x: GET_VAR 'val x: kotlin.Int [val] declared in <root>.test4' type=kotlin.Int origin=null
|
||||
y: GET_VAR 'val y: <root>.P [val] declared in <root>.test4' type=<root>.P origin=null
|
||||
y: GET_VAR 'val y: @[EnhancedNullability] <root>.P [val] declared in <root>.test4' type=<root>.P origin=null
|
||||
|
||||
compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInDestructuringAssignment.fir.kt.txt
Vendored
+6
-5
@@ -60,8 +60,8 @@ fun test1() {
|
||||
|
||||
fun test2() {
|
||||
val <destruct>: @FlexibleNullability Q<@EnhancedNullability String, @EnhancedNullability String>? = notNullComponents()
|
||||
val x: String = <destruct>.component1() /*!! String */
|
||||
val y: String = <destruct>.component2() /*!! String */
|
||||
val x: @EnhancedNullability String = <destruct>.component1() /*!! String */
|
||||
val y: @EnhancedNullability String = <destruct>.component2() /*!! String */
|
||||
use(x = x, y = y)
|
||||
}
|
||||
|
||||
@@ -74,14 +74,15 @@ fun test2Desugared() {
|
||||
|
||||
fun test3() {
|
||||
val <destruct>: Q<@EnhancedNullability String, @EnhancedNullability String> = notNullQAndComponents() /*!! Q<@EnhancedNullability String, @EnhancedNullability String> */
|
||||
val x: String = <destruct>.component1() /*!! String */
|
||||
val y: String = <destruct>.component2() /*!! String */
|
||||
val x: @EnhancedNullability String = <destruct>.component1() /*!! String */
|
||||
val y: @EnhancedNullability String = <destruct>.component2() /*!! String */
|
||||
use(x = x, y = y)
|
||||
}
|
||||
|
||||
fun test4() {
|
||||
val <destruct>: IndexedValue<@EnhancedNullability P> = listOfNotNull() /*!! @FlexibleNullability List<@EnhancedNullability P> */.withIndex<@EnhancedNullability P>().first<IndexedValue<@EnhancedNullability P>>()
|
||||
val x: Int = <destruct>.component1()
|
||||
val y: P = <destruct>.component2() /*!! P */
|
||||
val y: @EnhancedNullability P = <destruct>.component2() /*!! P */
|
||||
use(x = x, y = y)
|
||||
}
|
||||
|
||||
|
||||
+21
-19
@@ -16,6 +16,7 @@ FILE fqName:<root> fileName:/enhancedNullabilityInForLoop.kt
|
||||
TYPE_OP type=<root>.P origin=IMPLICIT_NOTNULL typeOperand=<root>.P
|
||||
CALL 'public abstract fun next (): T of kotlin.collections.MutableIterator [fake_override,operator] declared in kotlin.collections.MutableIterator' type=@[EnhancedNullability] <root>.P origin=FOR_LOOP_NEXT
|
||||
$this: GET_VAR 'val tmp_0: kotlin.collections.MutableIterator<@[EnhancedNullability] <root>.P> [val] declared in <root>.testForInListUnused' type=kotlin.collections.MutableIterator<@[EnhancedNullability] <root>.P> origin=null
|
||||
BLOCK type=kotlin.Unit origin=null
|
||||
FUN name:testForInListDestructured visibility:public modality:FINAL <> () returnType:kotlin.Unit
|
||||
BLOCK_BODY
|
||||
BLOCK type=kotlin.Unit origin=FOR_LOOP
|
||||
@@ -26,17 +27,17 @@ FILE fqName:<root> fileName:/enhancedNullabilityInForLoop.kt
|
||||
condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [fake_override,operator] declared in kotlin.collections.MutableIterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT
|
||||
$this: GET_VAR 'val tmp_1: kotlin.collections.MutableIterator<@[EnhancedNullability] <root>.P> [val] declared in <root>.testForInListDestructured' type=kotlin.collections.MutableIterator<@[EnhancedNullability] <root>.P> origin=null
|
||||
body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE
|
||||
VAR FOR_LOOP_VARIABLE name:<destruct> type:<root>.P [val]
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:<root>.P [val]
|
||||
TYPE_OP type=<root>.P origin=IMPLICIT_NOTNULL typeOperand=<root>.P
|
||||
CALL 'public abstract fun next (): T of kotlin.collections.MutableIterator [fake_override,operator] declared in kotlin.collections.MutableIterator' type=@[EnhancedNullability] <root>.P origin=FOR_LOOP_NEXT
|
||||
$this: GET_VAR 'val tmp_1: kotlin.collections.MutableIterator<@[EnhancedNullability] <root>.P> [val] declared in <root>.testForInListDestructured' type=kotlin.collections.MutableIterator<@[EnhancedNullability] <root>.P> origin=null
|
||||
VAR name:x type:kotlin.Int [val]
|
||||
CALL 'public final fun component1 (): kotlin.Int [operator] declared in <root>.P' type=kotlin.Int origin=COMPONENT_N(index=1)
|
||||
$this: GET_VAR 'val tmp_2: <root>.P [val] declared in <root>.testForInListDestructured' type=<root>.P origin=null
|
||||
VAR name:y type:kotlin.Int [val]
|
||||
CALL 'public final fun component2 (): kotlin.Int [operator] declared in <root>.P' type=kotlin.Int origin=COMPONENT_N(index=2)
|
||||
$this: GET_VAR 'val tmp_2: <root>.P [val] declared in <root>.testForInListDestructured' type=<root>.P origin=null
|
||||
BLOCK type=kotlin.Unit origin=null
|
||||
VAR name:x type:kotlin.Int [val]
|
||||
CALL 'public final fun component1 (): kotlin.Int [operator] declared in <root>.P' type=kotlin.Int origin=null
|
||||
$this: GET_VAR 'val <destruct>: <root>.P [val] declared in <root>.testForInListDestructured' type=<root>.P origin=null
|
||||
VAR name:y type:kotlin.Int [val]
|
||||
CALL 'public final fun component2 (): kotlin.Int [operator] declared in <root>.P' type=kotlin.Int origin=null
|
||||
$this: GET_VAR 'val <destruct>: <root>.P [val] declared in <root>.testForInListDestructured' type=<root>.P origin=null
|
||||
FUN name:testDesugaredForInList visibility:public modality:FINAL <> () returnType:kotlin.Unit
|
||||
BLOCK_BODY
|
||||
VAR name:iterator type:kotlin.collections.MutableIterator<@[EnhancedNullability] <root>.P> [val]
|
||||
@@ -54,32 +55,33 @@ FILE fqName:<root> fileName:/enhancedNullabilityInForLoop.kt
|
||||
VALUE_PARAMETER name:j index:0 type:<root>.J
|
||||
BLOCK_BODY
|
||||
BLOCK type=kotlin.Unit origin=FOR_LOOP
|
||||
VAR FOR_LOOP_ITERATOR name:tmp_2 type:kotlin.collections.Iterator<@[EnhancedNullability] <root>.P> [val]
|
||||
VAR FOR_LOOP_ITERATOR name:tmp_3 type:kotlin.collections.Iterator<@[EnhancedNullability] <root>.P> [val]
|
||||
CALL 'public final fun iterator (): kotlin.collections.Iterator<T of kotlin.Array> [operator] declared in kotlin.Array' type=kotlin.collections.Iterator<@[EnhancedNullability] <root>.P> origin=null
|
||||
$this: CALL 'public open fun arrayOfNotNull (): @[EnhancedNullability] kotlin.Array<out @[EnhancedNullability] <root>.P> declared in <root>.J' type=@[EnhancedNullability] kotlin.Array<out @[EnhancedNullability] <root>.P> origin=null
|
||||
$this: GET_VAR 'j: <root>.J declared in <root>.testForInArrayUnused' type=<root>.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<@[EnhancedNullability] <root>.P> [val] declared in <root>.testForInArrayUnused' type=kotlin.collections.Iterator<@[EnhancedNullability] <root>.P> origin=null
|
||||
$this: GET_VAR 'val tmp_3: kotlin.collections.Iterator<@[EnhancedNullability] <root>.P> [val] declared in <root>.testForInArrayUnused' type=kotlin.collections.Iterator<@[EnhancedNullability] <root>.P> origin=null
|
||||
body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE
|
||||
VAR FOR_LOOP_VARIABLE name:x type:<root>.P [val]
|
||||
TYPE_OP type=<root>.P origin=IMPLICIT_NOTNULL typeOperand=<root>.P
|
||||
CALL 'public abstract fun next (): T of kotlin.collections.Iterator [operator] declared in kotlin.collections.Iterator' type=@[EnhancedNullability] <root>.P origin=FOR_LOOP_NEXT
|
||||
$this: GET_VAR 'val tmp_2: kotlin.collections.Iterator<@[EnhancedNullability] <root>.P> [val] declared in <root>.testForInArrayUnused' type=kotlin.collections.Iterator<@[EnhancedNullability] <root>.P> origin=null
|
||||
$this: GET_VAR 'val tmp_3: kotlin.collections.Iterator<@[EnhancedNullability] <root>.P> [val] declared in <root>.testForInArrayUnused' type=kotlin.collections.Iterator<@[EnhancedNullability] <root>.P> origin=null
|
||||
BLOCK type=kotlin.Unit origin=null
|
||||
FUN name:testForInListUse visibility:public modality:FINAL <> () returnType:kotlin.Unit
|
||||
BLOCK_BODY
|
||||
BLOCK type=kotlin.Unit origin=FOR_LOOP
|
||||
VAR FOR_LOOP_ITERATOR name:tmp_3 type:kotlin.collections.MutableIterator<@[EnhancedNullability] <root>.P> [val]
|
||||
VAR FOR_LOOP_ITERATOR name:tmp_4 type:kotlin.collections.MutableIterator<@[EnhancedNullability] <root>.P> [val]
|
||||
CALL 'public abstract fun iterator (): kotlin.collections.MutableIterator<E of kotlin.collections.MutableList> [fake_override,operator] declared in kotlin.collections.MutableList' type=kotlin.collections.MutableIterator<@[EnhancedNullability] <root>.P> origin=FOR_LOOP_ITERATOR
|
||||
$this: CALL 'public open fun listOfNotNull (): @[FlexibleNullability] kotlin.collections.List<@[EnhancedNullability] <root>.P>? declared in <root>.J' type=@[FlexibleNullability] kotlin.collections.List<@[EnhancedNullability] <root>.P>? 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.MutableIterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT
|
||||
$this: GET_VAR 'val tmp_3: kotlin.collections.MutableIterator<@[EnhancedNullability] <root>.P> [val] declared in <root>.testForInListUse' type=kotlin.collections.MutableIterator<@[EnhancedNullability] <root>.P> origin=null
|
||||
$this: GET_VAR 'val tmp_4: kotlin.collections.MutableIterator<@[EnhancedNullability] <root>.P> [val] declared in <root>.testForInListUse' type=kotlin.collections.MutableIterator<@[EnhancedNullability] <root>.P> origin=null
|
||||
body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE
|
||||
VAR FOR_LOOP_VARIABLE name:x type:<root>.P [val]
|
||||
TYPE_OP type=<root>.P origin=IMPLICIT_NOTNULL typeOperand=<root>.P
|
||||
CALL 'public abstract fun next (): T of kotlin.collections.MutableIterator [fake_override,operator] declared in kotlin.collections.MutableIterator' type=@[EnhancedNullability] <root>.P origin=FOR_LOOP_NEXT
|
||||
$this: GET_VAR 'val tmp_3: kotlin.collections.MutableIterator<@[EnhancedNullability] <root>.P> [val] declared in <root>.testForInListUse' type=kotlin.collections.MutableIterator<@[EnhancedNullability] <root>.P> origin=null
|
||||
$this: GET_VAR 'val tmp_4: kotlin.collections.MutableIterator<@[EnhancedNullability] <root>.P> [val] declared in <root>.testForInListUse' type=kotlin.collections.MutableIterator<@[EnhancedNullability] <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
|
||||
s: GET_VAR 'val x: <root>.P [val] declared in <root>.testForInListUse' type=<root>.P origin=null
|
||||
@@ -89,18 +91,18 @@ FILE fqName:<root> fileName:/enhancedNullabilityInForLoop.kt
|
||||
VALUE_PARAMETER name:j index:0 type:<root>.J
|
||||
BLOCK_BODY
|
||||
BLOCK type=kotlin.Unit origin=FOR_LOOP
|
||||
VAR FOR_LOOP_ITERATOR name:tmp_4 type:kotlin.collections.Iterator<@[EnhancedNullability] <root>.P> [val]
|
||||
VAR FOR_LOOP_ITERATOR name:tmp_5 type:kotlin.collections.Iterator<@[EnhancedNullability] <root>.P> [val]
|
||||
CALL 'public final fun iterator (): kotlin.collections.Iterator<T of kotlin.Array> [operator] declared in kotlin.Array' type=kotlin.collections.Iterator<@[EnhancedNullability] <root>.P> origin=null
|
||||
$this: CALL 'public open fun arrayOfNotNull (): @[EnhancedNullability] kotlin.Array<out @[EnhancedNullability] <root>.P> declared in <root>.J' type=@[EnhancedNullability] kotlin.Array<out @[EnhancedNullability] <root>.P> origin=null
|
||||
$this: GET_VAR 'j: <root>.J declared in <root>.testForInArrayUse' type=<root>.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<@[EnhancedNullability] <root>.P> [val] declared in <root>.testForInArrayUse' type=kotlin.collections.Iterator<@[EnhancedNullability] <root>.P> origin=null
|
||||
$this: GET_VAR 'val tmp_5: kotlin.collections.Iterator<@[EnhancedNullability] <root>.P> [val] declared in <root>.testForInArrayUse' type=kotlin.collections.Iterator<@[EnhancedNullability] <root>.P> origin=null
|
||||
body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE
|
||||
VAR FOR_LOOP_VARIABLE name:x type:<root>.P [val]
|
||||
TYPE_OP type=<root>.P origin=IMPLICIT_NOTNULL typeOperand=<root>.P
|
||||
CALL 'public abstract fun next (): T of kotlin.collections.Iterator [operator] declared in kotlin.collections.Iterator' type=@[EnhancedNullability] <root>.P origin=FOR_LOOP_NEXT
|
||||
$this: GET_VAR 'val tmp_4: kotlin.collections.Iterator<@[EnhancedNullability] <root>.P> [val] declared in <root>.testForInArrayUse' type=kotlin.collections.Iterator<@[EnhancedNullability] <root>.P> origin=null
|
||||
$this: GET_VAR 'val tmp_5: kotlin.collections.Iterator<@[EnhancedNullability] <root>.P> [val] declared in <root>.testForInArrayUse' type=kotlin.collections.Iterator<@[EnhancedNullability] <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
|
||||
s: GET_VAR 'val x: <root>.P [val] declared in <root>.testForInArrayUse' type=<root>.P origin=null
|
||||
@@ -199,7 +201,7 @@ FILE fqName:<root> fileName:/enhancedNullabilityInForLoop.kt
|
||||
GET_VAR 'other: kotlin.Any? declared in <root>.P.equals' type=kotlin.Any? origin=null
|
||||
then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in <root>.P'
|
||||
CONST Boolean type=kotlin.Boolean value=false
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_5 type:<root>.P [val]
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_6 type:<root>.P [val]
|
||||
TYPE_OP type=<root>.P origin=CAST typeOperand=<root>.P
|
||||
GET_VAR 'other: kotlin.Any? declared in <root>.P.equals' type=kotlin.Any? origin=null
|
||||
WHEN type=kotlin.Unit origin=null
|
||||
@@ -209,7 +211,7 @@ FILE fqName:<root> fileName:/enhancedNullabilityInForLoop.kt
|
||||
arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
|
||||
receiver: GET_VAR '<this>: <root>.P declared in <root>.P.equals' type=<root>.P origin=null
|
||||
arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
|
||||
receiver: GET_VAR 'val tmp_5: <root>.P [val] declared in <root>.P.equals' type=<root>.P origin=null
|
||||
receiver: GET_VAR 'val tmp_6: <root>.P [val] declared in <root>.P.equals' type=<root>.P origin=null
|
||||
then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in <root>.P'
|
||||
CONST Boolean type=kotlin.Boolean value=false
|
||||
WHEN type=kotlin.Unit origin=null
|
||||
@@ -219,7 +221,7 @@ FILE fqName:<root> fileName:/enhancedNullabilityInForLoop.kt
|
||||
arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
|
||||
receiver: GET_VAR '<this>: <root>.P declared in <root>.P.equals' type=<root>.P origin=null
|
||||
arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
|
||||
receiver: GET_VAR 'val tmp_5: <root>.P [val] declared in <root>.P.equals' type=<root>.P origin=null
|
||||
receiver: GET_VAR 'val tmp_6: <root>.P [val] declared in <root>.P.equals' type=<root>.P origin=null
|
||||
then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in <root>.P'
|
||||
CONST Boolean type=kotlin.Boolean value=false
|
||||
RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in <root>.P'
|
||||
|
||||
+7
-2
@@ -6,6 +6,8 @@ fun testForInListUnused() {
|
||||
val <iterator>: MutableIterator<@EnhancedNullability P> = listOfNotNull().iterator()
|
||||
while (<iterator>.hasNext()) { // BLOCK
|
||||
val x: P = <iterator>.next() /*!! P */
|
||||
{ // BLOCK
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -15,9 +17,9 @@ fun testForInListDestructured() {
|
||||
val <iterator>: MutableIterator<@EnhancedNullability P> = listOfNotNull().iterator()
|
||||
while (<iterator>.hasNext()) { // BLOCK
|
||||
val <destruct>: P = <iterator>.next() /*!! P */
|
||||
val x: Int = <destruct>.component1()
|
||||
val y: Int = <destruct>.component2()
|
||||
{ // BLOCK
|
||||
val x: Int = <destruct>.component1()
|
||||
val y: Int = <destruct>.component2()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -35,6 +37,8 @@ fun testForInArrayUnused(j: J) {
|
||||
val <iterator>: Iterator<@EnhancedNullability P> = j.arrayOfNotNull().iterator()
|
||||
while (<iterator>.hasNext()) { // BLOCK
|
||||
val x: P = <iterator>.next() /*!! P */
|
||||
{ // BLOCK
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -125,3 +129,4 @@ data class P {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user