FIR: Rewrite Java type mapping

Previoisly, there were two places where mapping had happened:
- toConeKotlinTypeWithNullability
- enhancePossiblyFlexible

The first one was used for supertypes and bounds and the second one
was used for other signature parts

The main idea is to perform type mapping once to a flexible type,
and then use it as it's needed (it's lower bound, or for the further ehnancement)

Also, this commit fixes flexibility for type arguments, see the tests
This commit is contained in:
Denis Zharkov
2020-02-18 19:53:40 +03:00
parent 748a326104
commit 2ad8488e6a
42 changed files with 452 additions and 358 deletions
+9 -9
View File
@@ -16,19 +16,19 @@ FILE fqName:<root> fileName:/builtinMap.kt
pair: GET_VAR 'pair: kotlin.Pair<K1 of <root>.plus, V1 of <root>.plus> declared in <root>.plus' type=kotlin.Pair<K1 of <root>.plus, V1 of <root>.plus> origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CALL 'public final fun apply <T> (block: kotlin.Function1<T of kotlin.apply, kotlin.Unit>): T of kotlin.apply [inline] declared in kotlin' type=java.util.LinkedHashMap<K1 of <root>.plus, V1 of <root>.plus> origin=null
<T>: java.util.LinkedHashMap<K1 of <root>.plus, V1 of <root>.plus>
$receiver: CONSTRUCTOR_CALL 'public constructor <init> (p0: kotlin.collections.Map<out K of <uninitialized parent>, out V of <uninitialized parent>>?) declared in java.util.LinkedHashMap' type=java.util.LinkedHashMap<K1 of <root>.plus, V1 of <root>.plus> origin=null
<class: K>: K1 of <root>.plus
<class: V>: V1 of <root>.plus
then: CALL 'public final fun apply <T> (block: kotlin.Function1<T of kotlin.apply, kotlin.Unit>): T of kotlin.apply [inline] declared in kotlin' type=java.util.LinkedHashMap<K1 of <root>.plus?, V1 of <root>.plus?> origin=null
<T>: java.util.LinkedHashMap<K1 of <root>.plus?, V1 of <root>.plus?>
$receiver: CONSTRUCTOR_CALL 'public constructor <init> (p0: kotlin.collections.Map<out K of <uninitialized parent>?, out V of <uninitialized parent>?>?) declared in java.util.LinkedHashMap' type=java.util.LinkedHashMap<K1 of <root>.plus?, V1 of <root>.plus?> origin=null
<class: K>: K1 of <root>.plus?
<class: V>: V1 of <root>.plus?
p0: GET_VAR '<this>: kotlin.collections.Map<out K1 of <root>.plus, V1 of <root>.plus> declared in <root>.plus' type=kotlin.collections.Map<out K1 of <root>.plus, V1 of <root>.plus> origin=null
block: FUN_EXPR type=kotlin.Function1<java.util.LinkedHashMap<K1 of <root>.plus, V1 of <root>.plus>, kotlin.Unit> origin=LAMBDA
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> ($receiver:java.util.LinkedHashMap<K1 of <root>.plus, V1 of <root>.plus>) returnType:kotlin.Unit
$receiver: VALUE_PARAMETER name:<this> type:java.util.LinkedHashMap<K1 of <root>.plus, V1 of <root>.plus>
block: FUN_EXPR type=kotlin.Function1<java.util.LinkedHashMap<K1 of <root>.plus?, V1 of <root>.plus?>, kotlin.Unit> origin=LAMBDA
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> ($receiver:java.util.LinkedHashMap<K1 of <root>.plus?, V1 of <root>.plus?>) returnType:kotlin.Unit
$receiver: VALUE_PARAMETER name:<this> type:java.util.LinkedHashMap<K1 of <root>.plus?, V1 of <root>.plus?>
BLOCK_BODY
RETURN type=kotlin.Nothing from='local final fun <anonymous> (): kotlin.Unit declared in <root>.plus'
CALL 'public open fun put (p0: K1 of <root>.plus?, p1: V1 of <root>.plus?): V1 of <root>.plus? [operator] declared in java.util.HashMap' type=V1 of <root>.plus? origin=null
$this: GET_VAR '<this>: java.util.LinkedHashMap<K1 of <root>.plus, V1 of <root>.plus> declared in special.<anonymous>' type=java.util.LinkedHashMap<K1 of <root>.plus, V1 of <root>.plus> origin=null
$this: GET_VAR '<this>: java.util.LinkedHashMap<K1 of <root>.plus?, V1 of <root>.plus?> declared in special.<anonymous>' type=java.util.LinkedHashMap<K1 of <root>.plus?, V1 of <root>.plus?> origin=null
p0: CALL 'public final fun <get-first> (): K1 of <root>.plus declared in kotlin.Pair' type=K1 of <root>.plus origin=null
$this: GET_VAR 'pair: kotlin.Pair<K1 of <root>.plus, V1 of <root>.plus> declared in <root>.plus' type=kotlin.Pair<K1 of <root>.plus, V1 of <root>.plus> origin=null
p1: CALL 'public final fun <get-second> (): V1 of <root>.plus declared in kotlin.Pair' type=V1 of <root>.plus origin=null
@@ -130,57 +130,57 @@ FILE fqName:<root> fileName:/enhancedNullabilityInDestructuringAssignment.kt
y: GET_VAR 'val y: kotlin.Int [val] declared in <root>.test1' type=kotlin.Int origin=null
FUN name:test2 visibility:public modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:<root>.Q<kotlin.String, kotlin.String>? [val]
CALL 'public open fun notNullComponents (): <root>.Q<kotlin.String, kotlin.String>? [operator] declared in <root>.J' type=<root>.Q<kotlin.String, kotlin.String>? origin=null
VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:<root>.Q<kotlin.String, kotlin.String?>? [val]
CALL 'public open fun notNullComponents (): <root>.Q<kotlin.String, kotlin.String?>? [operator] declared in <root>.J' type=<root>.Q<kotlin.String, kotlin.String?>? origin=null
VAR name:x type:kotlin.String [val]
CALL 'public final fun component1 (): kotlin.String [operator] declared in <root>.Q' type=kotlin.String origin=null
$this: GET_VAR 'val tmp_1: <root>.Q<kotlin.String, kotlin.String>? [val] declared in <root>.test2' type=<root>.Q<kotlin.String, kotlin.String>? origin=null
VAR name:y type:kotlin.String [val]
CALL 'public final fun component2 (): kotlin.String [operator] declared in <root>.Q' type=kotlin.String origin=null
$this: GET_VAR 'val tmp_1: <root>.Q<kotlin.String, kotlin.String>? [val] declared in <root>.test2' type=<root>.Q<kotlin.String, kotlin.String>? origin=null
$this: GET_VAR 'val tmp_1: <root>.Q<kotlin.String, kotlin.String?>? [val] declared in <root>.test2' type=<root>.Q<kotlin.String, kotlin.String?>? origin=null
VAR name:y type:kotlin.String? [val]
CALL 'public final fun component2 (): kotlin.String? [operator] declared in <root>.Q' type=kotlin.String? origin=null
$this: GET_VAR 'val tmp_1: <root>.Q<kotlin.String, kotlin.String?>? [val] declared in <root>.test2' type=<root>.Q<kotlin.String, 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
y: GET_VAR 'val y: 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:<root>.Q<kotlin.String, kotlin.String>? [val]
CALL 'public open fun notNullComponents (): <root>.Q<kotlin.String, kotlin.String>? [operator] declared in <root>.J' type=<root>.Q<kotlin.String, kotlin.String>? origin=null
VAR name:tmp type:<root>.Q<kotlin.String, kotlin.String?>? [val]
CALL 'public open fun notNullComponents (): <root>.Q<kotlin.String, kotlin.String?>? [operator] declared in <root>.J' type=<root>.Q<kotlin.String, kotlin.String?>? origin=null
VAR name:x type:kotlin.String [val]
CALL 'public final fun component1 (): kotlin.String [operator] declared in <root>.Q' type=kotlin.String origin=null
$this: GET_VAR 'val tmp: <root>.Q<kotlin.String, kotlin.String>? [val] declared in <root>.test2Desugared' type=<root>.Q<kotlin.String, kotlin.String>? origin=null
VAR name:y type:kotlin.String [val]
CALL 'public final fun component2 (): kotlin.String [operator] declared in <root>.Q' type=kotlin.String origin=null
$this: GET_VAR 'val tmp: <root>.Q<kotlin.String, kotlin.String>? [val] declared in <root>.test2Desugared' type=<root>.Q<kotlin.String, kotlin.String>? origin=null
$this: GET_VAR 'val tmp: <root>.Q<kotlin.String, kotlin.String?>? [val] declared in <root>.test2Desugared' type=<root>.Q<kotlin.String, kotlin.String?>? origin=null
VAR name:y type:kotlin.String? [val]
CALL 'public final fun component2 (): kotlin.String? [operator] declared in <root>.Q' type=kotlin.String? origin=null
$this: GET_VAR 'val tmp: <root>.Q<kotlin.String, kotlin.String?>? [val] declared in <root>.test2Desugared' type=<root>.Q<kotlin.String, 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>.test2Desugared' type=kotlin.String origin=null
y: GET_VAR 'val y: kotlin.String [val] declared in <root>.test2Desugared' type=kotlin.String origin=null
y: GET_VAR 'val y: kotlin.String? [val] declared in <root>.test2Desugared' type=kotlin.String? origin=null
FUN name:test3 visibility:public modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:<root>.Q<kotlin.String, kotlin.String> [val]
CALL 'public open fun notNullQAndComponents (): <root>.Q<kotlin.String, kotlin.String> [operator] declared in <root>.J' type=<root>.Q<kotlin.String, kotlin.String> origin=null
VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:<root>.Q<kotlin.String, kotlin.String?> [val]
CALL 'public open fun notNullQAndComponents (): <root>.Q<kotlin.String, kotlin.String?> [operator] declared in <root>.J' type=<root>.Q<kotlin.String, kotlin.String?> origin=null
VAR name:x type:kotlin.String [val]
CALL 'public final fun component1 (): kotlin.String [operator] declared in <root>.Q' type=kotlin.String origin=null
$this: GET_VAR 'val tmp_2: <root>.Q<kotlin.String, kotlin.String> [val] declared in <root>.test3' type=<root>.Q<kotlin.String, kotlin.String> origin=null
VAR name:y type:kotlin.String [val]
CALL 'public final fun component2 (): kotlin.String [operator] declared in <root>.Q' type=kotlin.String origin=null
$this: GET_VAR 'val tmp_2: <root>.Q<kotlin.String, kotlin.String> [val] declared in <root>.test3' type=<root>.Q<kotlin.String, kotlin.String> origin=null
$this: GET_VAR 'val tmp_2: <root>.Q<kotlin.String, kotlin.String?> [val] declared in <root>.test3' type=<root>.Q<kotlin.String, kotlin.String?> origin=null
VAR name:y type:kotlin.String? [val]
CALL 'public final fun component2 (): kotlin.String? [operator] declared in <root>.Q' type=kotlin.String? origin=null
$this: GET_VAR 'val tmp_2: <root>.Q<kotlin.String, kotlin.String?> [val] declared in <root>.test3' type=<root>.Q<kotlin.String, 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
y: GET_VAR 'val y: 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<<root>.P> [val]
CALL 'public final fun first <T> (): T of kotlin.collections.first declared in kotlin.collections' type=kotlin.collections.IndexedValue<<root>.P> origin=null
<T>: kotlin.collections.IndexedValue<<root>.P>
$receiver: CALL 'public final fun withIndex <T> (): kotlin.collections.Iterable<kotlin.collections.IndexedValue<T of kotlin.collections.withIndex>> declared in kotlin.collections' type=kotlin.collections.Iterable<kotlin.collections.IndexedValue<<root>.P>> origin=null
<T>: <root>.P
$receiver: CALL 'public open fun listOfNotNull (): kotlin.collections.List<<root>.P>? [operator] declared in <root>.J' type=kotlin.collections.List<<root>.P>? origin=null
VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:kotlin.collections.IndexedValue<<root>.P?> [val]
CALL 'public final fun first <T> (): T of kotlin.collections.first declared in kotlin.collections' type=kotlin.collections.IndexedValue<<root>.P?> origin=null
<T>: kotlin.collections.IndexedValue<<root>.P?>
$receiver: CALL 'public final fun withIndex <T> (): kotlin.collections.Iterable<kotlin.collections.IndexedValue<T of kotlin.collections.withIndex>> declared in kotlin.collections' type=kotlin.collections.Iterable<kotlin.collections.IndexedValue<<root>.P?>> origin=null
<T>: <root>.P?
$receiver: CALL 'public open fun listOfNotNull (): kotlin.collections.List<<root>.P?>? [operator] declared in <root>.J' type=kotlin.collections.List<<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
$this: GET_VAR 'val tmp_3: kotlin.collections.IndexedValue<<root>.P> [val] declared in <root>.test4' type=kotlin.collections.IndexedValue<<root>.P> origin=null
VAR name:y type:<root>.P [val]
CALL 'public final fun component2 (): <root>.P [operator] declared in kotlin.collections.IndexedValue' type=<root>.P origin=null
$this: GET_VAR 'val tmp_3: kotlin.collections.IndexedValue<<root>.P> [val] declared in <root>.test4' type=kotlin.collections.IndexedValue<<root>.P> origin=null
$this: GET_VAR 'val tmp_3: kotlin.collections.IndexedValue<<root>.P?> [val] declared in <root>.test4' type=kotlin.collections.IndexedValue<<root>.P?> origin=null
VAR name:y type:<root>.P? [val]
CALL 'public final fun component2 (): <root>.P? [operator] declared in kotlin.collections.IndexedValue' type=<root>.P? origin=null
$this: GET_VAR 'val tmp_3: kotlin.collections.IndexedValue<<root>.P?> [val] declared in <root>.test4' type=kotlin.collections.IndexedValue<<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: <root>.P? [val] declared in <root>.test4' type=<root>.P? origin=null
@@ -5,54 +5,54 @@ FILE fqName:<root> fileName:/enhancedNullabilityInForLoop.kt
FUN name:testForInListUnused visibility:public modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
BLOCK type=kotlin.Unit origin=FOR_LOOP
VAR FOR_LOOP_ITERATOR name:tmp_0 type:kotlin.collections.MutableIterator<<root>.P> [val]
CALL 'public abstract fun iterator (): kotlin.collections.MutableIterator<<root>.P> [operator] declared in kotlin.collections.MutableCollection' type=kotlin.collections.MutableIterator<<root>.P> origin=FOR_LOOP_ITERATOR
$this: CALL 'public open fun listOfNotNull (): kotlin.collections.List<<root>.P>? [operator] declared in <root>.J' type=kotlin.collections.List<<root>.P>? origin=null
VAR FOR_LOOP_ITERATOR name:tmp_0 type:kotlin.collections.MutableIterator<<root>.P?> [val]
CALL 'public abstract fun iterator (): kotlin.collections.MutableIterator<<root>.P?> [operator] declared in kotlin.collections.MutableCollection' type=kotlin.collections.MutableIterator<<root>.P?> origin=FOR_LOOP_ITERATOR
$this: CALL 'public open fun listOfNotNull (): kotlin.collections.List<<root>.P?>? [operator] declared in <root>.J' type=kotlin.collections.List<<root>.P?>? origin=null
WHILE label=null origin=FOR_LOOP_INNER_WHILE
condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT
$this: GET_VAR 'val tmp_0: kotlin.collections.MutableIterator<<root>.P> [val] declared in <root>.testForInListUnused' type=kotlin.collections.MutableIterator<<root>.P> origin=null
$this: GET_VAR 'val tmp_0: kotlin.collections.MutableIterator<<root>.P?> [val] declared in <root>.testForInListUnused' type=kotlin.collections.MutableIterator<<root>.P?> origin=null
body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE
VAR FOR_LOOP_VARIABLE name:x type:<root>.P [val]
CALL 'public abstract fun next (): T of kotlin.collections.MutableIterator [operator] declared in kotlin.collections.Iterator' type=<root>.P origin=FOR_LOOP_NEXT
$this: GET_VAR 'val tmp_0: kotlin.collections.MutableIterator<<root>.P> [val] declared in <root>.testForInListUnused' type=kotlin.collections.MutableIterator<<root>.P> origin=null
VAR FOR_LOOP_VARIABLE name:x type:<root>.P? [val]
CALL 'public abstract fun next (): T of kotlin.collections.MutableIterator [operator] declared in kotlin.collections.Iterator' type=<root>.P? origin=FOR_LOOP_NEXT
$this: GET_VAR 'val tmp_0: kotlin.collections.MutableIterator<<root>.P?> [val] declared in <root>.testForInListUnused' type=kotlin.collections.MutableIterator<<root>.P?> origin=null
FUN name:testForInListDestructured visibility:public modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
BLOCK type=kotlin.Unit origin=FOR_LOOP
VAR FOR_LOOP_ITERATOR name:tmp_1 type:kotlin.collections.MutableIterator<<root>.P> [val]
CALL 'public abstract fun iterator (): kotlin.collections.MutableIterator<<root>.P> [operator] declared in kotlin.collections.MutableCollection' type=kotlin.collections.MutableIterator<<root>.P> origin=FOR_LOOP_ITERATOR
$this: CALL 'public open fun listOfNotNull (): kotlin.collections.List<<root>.P>? [operator] declared in <root>.J' type=kotlin.collections.List<<root>.P>? origin=null
VAR FOR_LOOP_ITERATOR name:tmp_1 type:kotlin.collections.MutableIterator<<root>.P?> [val]
CALL 'public abstract fun iterator (): kotlin.collections.MutableIterator<<root>.P?> [operator] declared in kotlin.collections.MutableCollection' type=kotlin.collections.MutableIterator<<root>.P?> origin=FOR_LOOP_ITERATOR
$this: CALL 'public open fun listOfNotNull (): kotlin.collections.List<<root>.P?>? [operator] declared in <root>.J' type=kotlin.collections.List<<root>.P?>? origin=null
WHILE label=null origin=FOR_LOOP_INNER_WHILE
condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT
$this: GET_VAR 'val tmp_1: kotlin.collections.MutableIterator<<root>.P> [val] declared in <root>.testForInListDestructured' type=kotlin.collections.MutableIterator<<root>.P> origin=null
$this: GET_VAR 'val tmp_1: kotlin.collections.MutableIterator<<root>.P?> [val] declared in <root>.testForInListDestructured' type=kotlin.collections.MutableIterator<<root>.P?> origin=null
body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE
VAR FOR_LOOP_VARIABLE name:<destruct> type:<root>.P [val]
CALL 'public abstract fun next (): T of kotlin.collections.MutableIterator [operator] declared in kotlin.collections.Iterator' type=<root>.P origin=FOR_LOOP_NEXT
$this: GET_VAR 'val tmp_1: kotlin.collections.MutableIterator<<root>.P> [val] declared in <root>.testForInListDestructured' type=kotlin.collections.MutableIterator<<root>.P> origin=null
VAR FOR_LOOP_VARIABLE name:<destruct> type:<root>.P? [val]
CALL 'public abstract fun next (): T of kotlin.collections.MutableIterator [operator] declared in kotlin.collections.Iterator' type=<root>.P? origin=FOR_LOOP_NEXT
$this: GET_VAR 'val tmp_1: kotlin.collections.MutableIterator<<root>.P?> [val] declared in <root>.testForInListDestructured' type=kotlin.collections.MutableIterator<<root>.P?> origin=null
VAR name:x type:kotlin.Int [val]
CALL 'public final fun component1 (): kotlin.Int 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
$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 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
$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<<root>.P> [val]
CALL 'public abstract fun iterator (): kotlin.collections.MutableIterator<<root>.P> [operator] declared in kotlin.collections.MutableCollection' type=kotlin.collections.MutableIterator<<root>.P> origin=null
$this: CALL 'public open fun listOfNotNull (): kotlin.collections.List<<root>.P>? [operator] declared in <root>.J' type=kotlin.collections.List<<root>.P>? origin=null
VAR name:iterator type:kotlin.collections.MutableIterator<<root>.P?> [val]
CALL 'public abstract fun iterator (): kotlin.collections.MutableIterator<<root>.P?> [operator] declared in kotlin.collections.MutableCollection' type=kotlin.collections.MutableIterator<<root>.P?> origin=null
$this: CALL 'public open fun listOfNotNull (): kotlin.collections.List<<root>.P?>? [operator] declared in <root>.J' type=kotlin.collections.List<<root>.P?>? origin=null
WHILE label=null origin=WHILE_LOOP
condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=null
$this: GET_VAR 'val iterator: kotlin.collections.MutableIterator<<root>.P> [val] declared in <root>.testDesugaredForInList' type=kotlin.collections.MutableIterator<<root>.P> origin=null
$this: GET_VAR 'val iterator: kotlin.collections.MutableIterator<<root>.P?> [val] declared in <root>.testDesugaredForInList' type=kotlin.collections.MutableIterator<<root>.P?> origin=null
body: BLOCK type=kotlin.Unit origin=WHILE_LOOP
VAR name:x type:<root>.P [val]
CALL 'public abstract fun next (): T of kotlin.collections.MutableIterator [operator] declared in kotlin.collections.Iterator' type=<root>.P origin=null
$this: GET_VAR 'val iterator: kotlin.collections.MutableIterator<<root>.P> [val] declared in <root>.testDesugaredForInList' type=kotlin.collections.MutableIterator<<root>.P> origin=null
VAR name:x type:<root>.P? [val]
CALL 'public abstract fun next (): T of kotlin.collections.MutableIterator [operator] declared in kotlin.collections.Iterator' type=<root>.P? origin=null
$this: GET_VAR 'val iterator: kotlin.collections.MutableIterator<<root>.P?> [val] declared in <root>.testDesugaredForInList' type=kotlin.collections.MutableIterator<<root>.P?> origin=null
FUN name:testForInArrayUnused visibility:public modality:FINAL <> (j:<root>.J) returnType:kotlin.Unit
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<<root>.P?> [val]
CALL 'public final fun iterator (): kotlin.collections.Iterator<<root>.P?> [operator] declared in kotlin.Array' type=kotlin.collections.Iterator<<root>.P?> origin=null
$this: CALL 'public open fun arrayOfNotNull (): kotlin.Array<out <root>.P?>? [operator] declared in <root>.J' type=kotlin.Array<out <root>.P?>? origin=null
$this: CALL 'public open fun arrayOfNotNull (): kotlin.Array<out <root>.P?> [operator] declared in <root>.J' type=kotlin.Array<out <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
@@ -64,27 +64,27 @@ FILE fqName:<root> fileName:/enhancedNullabilityInForLoop.kt
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<<root>.P> [val]
CALL 'public abstract fun iterator (): kotlin.collections.MutableIterator<<root>.P> [operator] declared in kotlin.collections.MutableCollection' type=kotlin.collections.MutableIterator<<root>.P> origin=FOR_LOOP_ITERATOR
$this: CALL 'public open fun listOfNotNull (): kotlin.collections.List<<root>.P>? [operator] declared in <root>.J' type=kotlin.collections.List<<root>.P>? origin=null
VAR FOR_LOOP_ITERATOR name:tmp_3 type:kotlin.collections.MutableIterator<<root>.P?> [val]
CALL 'public abstract fun iterator (): kotlin.collections.MutableIterator<<root>.P?> [operator] declared in kotlin.collections.MutableCollection' type=kotlin.collections.MutableIterator<<root>.P?> origin=FOR_LOOP_ITERATOR
$this: CALL 'public open fun listOfNotNull (): kotlin.collections.List<<root>.P?>? [operator] declared in <root>.J' type=kotlin.collections.List<<root>.P?>? origin=null
WHILE label=null origin=FOR_LOOP_INNER_WHILE
condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT
$this: GET_VAR 'val tmp_3: kotlin.collections.MutableIterator<<root>.P> [val] declared in <root>.testForInListUse' type=kotlin.collections.MutableIterator<<root>.P> origin=null
$this: GET_VAR 'val tmp_3: kotlin.collections.MutableIterator<<root>.P?> [val] declared in <root>.testForInListUse' type=kotlin.collections.MutableIterator<<root>.P?> origin=null
body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE
VAR FOR_LOOP_VARIABLE name:x type:<root>.P [val]
CALL 'public abstract fun next (): T of kotlin.collections.MutableIterator [operator] declared in kotlin.collections.Iterator' type=<root>.P origin=FOR_LOOP_NEXT
$this: GET_VAR 'val tmp_3: kotlin.collections.MutableIterator<<root>.P> [val] declared in <root>.testForInListUse' type=kotlin.collections.MutableIterator<<root>.P> origin=null
VAR FOR_LOOP_VARIABLE name:x type:<root>.P? [val]
CALL 'public abstract fun next (): T of kotlin.collections.MutableIterator [operator] declared in kotlin.collections.Iterator' type=<root>.P? origin=FOR_LOOP_NEXT
$this: GET_VAR 'val tmp_3: kotlin.collections.MutableIterator<<root>.P?> [val] declared in <root>.testForInListUse' type=kotlin.collections.MutableIterator<<root>.P?> 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
s: GET_VAR 'val x: <root>.P? [val] declared in <root>.testForInListUse' type=<root>.P? origin=null
CALL 'public open fun use (s: <root>.P): kotlin.Unit [operator] declared in <root>.J' type=kotlin.Unit origin=null
s: GET_VAR 'val x: <root>.P [val] declared in <root>.testForInListUse' type=<root>.P origin=null
s: GET_VAR 'val x: <root>.P? [val] declared in <root>.testForInListUse' type=<root>.P? origin=null
FUN name:testForInArrayUse visibility:public modality:FINAL <> (j:<root>.J) returnType:kotlin.Unit
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<<root>.P?> [val]
CALL 'public final fun iterator (): kotlin.collections.Iterator<<root>.P?> [operator] declared in kotlin.Array' type=kotlin.collections.Iterator<<root>.P?> origin=null
$this: CALL 'public open fun arrayOfNotNull (): kotlin.Array<out <root>.P?>? [operator] declared in <root>.J' type=kotlin.Array<out <root>.P?>? origin=null
$this: CALL 'public open fun arrayOfNotNull (): kotlin.Array<out <root>.P?> [operator] declared in <root>.J' type=kotlin.Array<out <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