[FIR2IR] Don't replace while loop and when branch body blocks with single expression. Skip some empty blocks.

https://youtrack.jetbrains.com/issue/KT-60264/K2-while-loop-body-block-sometimes-replaced-with-single-expression

Merge-request: KT-MR-12035
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
This commit is contained in:
Vladimir Sukharev
2023-09-18 15:27:19 +00:00
committed by Space Team
parent f4df4f8007
commit 9a2eff6487
61 changed files with 601 additions and 1102 deletions
+41 -35
View File
@@ -284,7 +284,7 @@ FILE fqName:<root> fileName:/ArrayMap.kt
BRANCH
if: CALL 'private final fun <get-notVisited> (): kotlin.Boolean declared in <root>.OneElementArrayMap.iterator.<no name provided>' type=kotlin.Boolean origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.OneElementArrayMap.iterator.<no name provided><T of <root>.OneElementArrayMap> declared in <root>.OneElementArrayMap.iterator.<no name provided>.next' type=<root>.OneElementArrayMap.iterator.<no name provided><T of <root>.OneElementArrayMap> origin=null
then: BLOCK type=kotlin.Nothing origin=null
then: BLOCK type=kotlin.Unit origin=null
CALL 'private final fun <set-notVisited> (<set-?>: kotlin.Boolean): kotlin.Unit declared in <root>.OneElementArrayMap.iterator.<no name provided>' type=kotlin.Unit origin=EQ
$this: GET_VAR '<this>: <root>.OneElementArrayMap.iterator.<no name provided><T of <root>.OneElementArrayMap> declared in <root>.OneElementArrayMap.iterator.<no name provided>.next' type=<root>.OneElementArrayMap.iterator.<no name provided><T of <root>.OneElementArrayMap> origin=null
<set-?>: CONST Boolean type=kotlin.Boolean value=false
@@ -293,8 +293,9 @@ FILE fqName:<root> fileName:/ArrayMap.kt
$this: GET_VAR '<this>: <root>.OneElementArrayMap<T of <root>.OneElementArrayMap> declared in <root>.OneElementArrayMap.iterator' type=<root>.OneElementArrayMap<T of <root>.OneElementArrayMap> origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: THROW type=kotlin.Nothing
CONSTRUCTOR_CALL 'public constructor <init> () declared in java.util.NoSuchElementException' type=java.util.NoSuchElementException origin=null
then: BLOCK type=kotlin.Unit origin=null
THROW type=kotlin.Nothing
CONSTRUCTOR_CALL 'public constructor <init> () declared in java.util.NoSuchElementException' type=java.util.NoSuchElementException 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 declared in kotlin.collections.Iterator
@@ -464,14 +465,15 @@ FILE fqName:<root> fileName:/ArrayMap.kt
arg1: CONST Null type=kotlin.Nothing? value=null
then: TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
BLOCK type=kotlin.Int origin=null
VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.Int [val]
CALL 'public open fun <get-size> (): kotlin.Int declared in <root>.ArrayMapImpl' type=kotlin.Int origin=GET_PROPERTY
BLOCK type=kotlin.Int origin=null
VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.Int [val]
CALL 'public open fun <get-size> (): kotlin.Int declared in <root>.ArrayMapImpl' type=kotlin.Int origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.ArrayMapImpl<T of <root>.ArrayMapImpl> declared in <root>.ArrayMapImpl.set' type=<root>.ArrayMapImpl<T of <root>.ArrayMapImpl> origin=null
CALL 'private open fun <set-size> (<set-?>: kotlin.Int): kotlin.Unit declared in <root>.ArrayMapImpl' type=kotlin.Unit origin=EQ
$this: GET_VAR '<this>: <root>.ArrayMapImpl<T of <root>.ArrayMapImpl> declared in <root>.ArrayMapImpl.set' type=<root>.ArrayMapImpl<T of <root>.ArrayMapImpl> origin=null
CALL 'private open fun <set-size> (<set-?>: kotlin.Int): kotlin.Unit declared in <root>.ArrayMapImpl' type=kotlin.Unit origin=EQ
$this: GET_VAR '<this>: <root>.ArrayMapImpl<T of <root>.ArrayMapImpl> declared in <root>.ArrayMapImpl.set' type=<root>.ArrayMapImpl<T of <root>.ArrayMapImpl> origin=null
<set-?>: CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null
$this: GET_VAR 'val tmp_0: kotlin.Int declared in <root>.ArrayMapImpl.set' type=kotlin.Int origin=null
GET_VAR 'val tmp_0: kotlin.Int declared in <root>.ArrayMapImpl.set' type=kotlin.Int origin=null
<set-?>: CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null
$this: GET_VAR 'val tmp_0: kotlin.Int declared in <root>.ArrayMapImpl.set' type=kotlin.Int origin=null
GET_VAR 'val tmp_0: kotlin.Int declared in <root>.ArrayMapImpl.set' type=kotlin.Int origin=null
CALL 'public final fun set (index: kotlin.Int, value: T of kotlin.Array): kotlin.Unit declared in kotlin.Array' type=kotlin.Unit origin=null
$this: CALL 'private final fun <get-data> (): kotlin.Array<kotlin.Any?> declared in <root>.ArrayMapImpl' type=kotlin.Array<kotlin.Any?> origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.ArrayMapImpl<T of <root>.ArrayMapImpl> declared in <root>.ArrayMapImpl.set' type=<root>.ArrayMapImpl<T of <root>.ArrayMapImpl> origin=null
@@ -542,15 +544,16 @@ FILE fqName:<root> fileName:/ArrayMap.kt
BLOCK_BODY
BLOCK type=kotlin.Unit origin=null
DO_WHILE label=null origin=DO_WHILE_LOOP
body: BLOCK type=kotlin.Int origin=POSTFIX_INCR
VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.Int [val]
CALL 'private final fun <get-index> (): kotlin.Int declared in <root>.ArrayMapImpl.iterator.<no name provided>' type=kotlin.Int origin=GET_PROPERTY
body: COMPOSITE type=kotlin.Unit origin=null
BLOCK type=kotlin.Int origin=POSTFIX_INCR
VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.Int [val]
CALL 'private final fun <get-index> (): kotlin.Int declared in <root>.ArrayMapImpl.iterator.<no name provided>' type=kotlin.Int origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.ArrayMapImpl.iterator.<no name provided><T of <root>.ArrayMapImpl> declared in <root>.ArrayMapImpl.iterator.<no name provided>.computeNext' type=<root>.ArrayMapImpl.iterator.<no name provided><T of <root>.ArrayMapImpl> origin=null
CALL 'private final fun <set-index> (<set-?>: kotlin.Int): kotlin.Unit declared in <root>.ArrayMapImpl.iterator.<no name provided>' type=kotlin.Unit origin=POSTFIX_INCR
$this: GET_VAR '<this>: <root>.ArrayMapImpl.iterator.<no name provided><T of <root>.ArrayMapImpl> declared in <root>.ArrayMapImpl.iterator.<no name provided>.computeNext' type=<root>.ArrayMapImpl.iterator.<no name provided><T of <root>.ArrayMapImpl> origin=null
CALL 'private final fun <set-index> (<set-?>: kotlin.Int): kotlin.Unit declared in <root>.ArrayMapImpl.iterator.<no name provided>' type=kotlin.Unit origin=POSTFIX_INCR
$this: GET_VAR '<this>: <root>.ArrayMapImpl.iterator.<no name provided><T of <root>.ArrayMapImpl> declared in <root>.ArrayMapImpl.iterator.<no name provided>.computeNext' type=<root>.ArrayMapImpl.iterator.<no name provided><T of <root>.ArrayMapImpl> origin=null
<set-?>: CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null
$this: GET_VAR 'val tmp_1: kotlin.Int declared in <root>.ArrayMapImpl.iterator.<no name provided>.computeNext' type=kotlin.Int origin=null
GET_VAR 'val tmp_1: kotlin.Int declared in <root>.ArrayMapImpl.iterator.<no name provided>.computeNext' type=kotlin.Int origin=null
<set-?>: CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null
$this: GET_VAR 'val tmp_1: kotlin.Int declared in <root>.ArrayMapImpl.iterator.<no name provided>.computeNext' type=kotlin.Int origin=null
GET_VAR 'val tmp_1: kotlin.Int declared in <root>.ArrayMapImpl.iterator.<no name provided>.computeNext' type=kotlin.Int origin=null
condition: WHEN type=kotlin.Boolean origin=ANDAND
BRANCH
if: CALL 'public final fun less (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=LT
@@ -577,18 +580,20 @@ FILE fqName:<root> fileName:/ArrayMap.kt
arg1: CALL 'public final fun <get-size> (): kotlin.Int declared in kotlin.Array' type=kotlin.Int origin=GET_PROPERTY
$this: CALL 'private final fun <get-data> (): kotlin.Array<kotlin.Any?> declared in <root>.ArrayMapImpl' type=kotlin.Array<kotlin.Any?> origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.ArrayMapImpl<T of <root>.ArrayMapImpl> declared in <root>.ArrayMapImpl.iterator' type=<root>.ArrayMapImpl<T of <root>.ArrayMapImpl> origin=null
then: CALL 'protected final fun done (): kotlin.Unit declared in <root>.ArrayMapImpl.iterator.<no name provided>' type=kotlin.Unit origin=null
$this: GET_VAR '<this>: <root>.ArrayMapImpl.iterator.<no name provided><T of <root>.ArrayMapImpl> declared in <root>.ArrayMapImpl.iterator.<no name provided>.computeNext' type=<root>.ArrayMapImpl.iterator.<no name provided><T of <root>.ArrayMapImpl> origin=null
then: BLOCK type=kotlin.Unit origin=null
CALL 'protected final fun done (): kotlin.Unit declared in <root>.ArrayMapImpl.iterator.<no name provided>' type=kotlin.Unit origin=null
$this: GET_VAR '<this>: <root>.ArrayMapImpl.iterator.<no name provided><T of <root>.ArrayMapImpl> declared in <root>.ArrayMapImpl.iterator.<no name provided>.computeNext' type=<root>.ArrayMapImpl.iterator.<no name provided><T of <root>.ArrayMapImpl> origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CALL 'protected final fun setNext (value: T of <root>.ArrayMapImpl): kotlin.Unit declared in <root>.ArrayMapImpl.iterator.<no name provided>' type=kotlin.Unit origin=null
$this: GET_VAR '<this>: <root>.ArrayMapImpl.iterator.<no name provided><T of <root>.ArrayMapImpl> declared in <root>.ArrayMapImpl.iterator.<no name provided>.computeNext' type=<root>.ArrayMapImpl.iterator.<no name provided><T of <root>.ArrayMapImpl> origin=null
value: TYPE_OP type=T of <root>.ArrayMapImpl origin=CAST typeOperand=T of <root>.ArrayMapImpl
CALL 'public final fun get (index: kotlin.Int): T of kotlin.Array declared in kotlin.Array' type=kotlin.Any? origin=null
$this: CALL 'private final fun <get-data> (): kotlin.Array<kotlin.Any?> declared in <root>.ArrayMapImpl' type=kotlin.Array<kotlin.Any?> origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.ArrayMapImpl<T of <root>.ArrayMapImpl> declared in <root>.ArrayMapImpl.iterator' type=<root>.ArrayMapImpl<T of <root>.ArrayMapImpl> origin=null
index: CALL 'private final fun <get-index> (): kotlin.Int declared in <root>.ArrayMapImpl.iterator.<no name provided>' type=kotlin.Int origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.ArrayMapImpl.iterator.<no name provided><T of <root>.ArrayMapImpl> declared in <root>.ArrayMapImpl.iterator.<no name provided>.computeNext' type=<root>.ArrayMapImpl.iterator.<no name provided><T of <root>.ArrayMapImpl> origin=null
then: BLOCK type=kotlin.Unit origin=null
CALL 'protected final fun setNext (value: T of <root>.ArrayMapImpl): kotlin.Unit declared in <root>.ArrayMapImpl.iterator.<no name provided>' type=kotlin.Unit origin=null
$this: GET_VAR '<this>: <root>.ArrayMapImpl.iterator.<no name provided><T of <root>.ArrayMapImpl> declared in <root>.ArrayMapImpl.iterator.<no name provided>.computeNext' type=<root>.ArrayMapImpl.iterator.<no name provided><T of <root>.ArrayMapImpl> origin=null
value: TYPE_OP type=T of <root>.ArrayMapImpl origin=CAST typeOperand=T of <root>.ArrayMapImpl
CALL 'public final fun get (index: kotlin.Int): T of kotlin.Array declared in kotlin.Array' type=kotlin.Any? origin=null
$this: CALL 'private final fun <get-data> (): kotlin.Array<kotlin.Any?> declared in <root>.ArrayMapImpl' type=kotlin.Array<kotlin.Any?> origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.ArrayMapImpl<T of <root>.ArrayMapImpl> declared in <root>.ArrayMapImpl.iterator' type=<root>.ArrayMapImpl<T of <root>.ArrayMapImpl> origin=null
index: CALL 'private final fun <get-index> (): kotlin.Int declared in <root>.ArrayMapImpl.iterator.<no name provided>' type=kotlin.Int origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.ArrayMapImpl.iterator.<no name provided><T of <root>.ArrayMapImpl> declared in <root>.ArrayMapImpl.iterator.<no name provided>.computeNext' type=<root>.ArrayMapImpl.iterator.<no name provided><T of <root>.ArrayMapImpl> origin=null
FUN FAKE_OVERRIDE name:done visibility:protected modality:FINAL <> ($this:kotlin.collections.AbstractIterator<T of <root>.ArrayMapImpl>) returnType:kotlin.Unit [fake_override]
overridden:
protected final fun done (): kotlin.Unit declared in kotlin.collections.AbstractIterator
@@ -635,14 +640,15 @@ FILE fqName:<root> fileName:/ArrayMap.kt
arg1: CONST Null type=kotlin.Nothing? value=null
then: TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
BLOCK type=kotlin.Int origin=null
VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:kotlin.Int [val]
CALL 'public open fun <get-size> (): kotlin.Int declared in <root>.ArrayMapImpl' type=kotlin.Int origin=GET_PROPERTY
BLOCK type=kotlin.Int origin=null
VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:kotlin.Int [val]
CALL 'public open fun <get-size> (): kotlin.Int declared in <root>.ArrayMapImpl' type=kotlin.Int origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.ArrayMapImpl<T of <root>.ArrayMapImpl> declared in <root>.ArrayMapImpl.remove' type=<root>.ArrayMapImpl<T of <root>.ArrayMapImpl> origin=null
CALL 'private open fun <set-size> (<set-?>: kotlin.Int): kotlin.Unit declared in <root>.ArrayMapImpl' type=kotlin.Unit origin=EQ
$this: GET_VAR '<this>: <root>.ArrayMapImpl<T of <root>.ArrayMapImpl> declared in <root>.ArrayMapImpl.remove' type=<root>.ArrayMapImpl<T of <root>.ArrayMapImpl> origin=null
CALL 'private open fun <set-size> (<set-?>: kotlin.Int): kotlin.Unit declared in <root>.ArrayMapImpl' type=kotlin.Unit origin=EQ
$this: GET_VAR '<this>: <root>.ArrayMapImpl<T of <root>.ArrayMapImpl> declared in <root>.ArrayMapImpl.remove' type=<root>.ArrayMapImpl<T of <root>.ArrayMapImpl> origin=null
<set-?>: CALL 'public final fun dec (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null
$this: GET_VAR 'val tmp_2: kotlin.Int declared in <root>.ArrayMapImpl.remove' type=kotlin.Int origin=null
GET_VAR 'val tmp_2: kotlin.Int declared in <root>.ArrayMapImpl.remove' type=kotlin.Int origin=null
<set-?>: CALL 'public final fun dec (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null
$this: GET_VAR 'val tmp_2: kotlin.Int declared in <root>.ArrayMapImpl.remove' type=kotlin.Int origin=null
GET_VAR 'val tmp_2: kotlin.Int declared in <root>.ArrayMapImpl.remove' type=kotlin.Int origin=null
CALL 'public final fun set (index: kotlin.Int, value: T of kotlin.Array): kotlin.Unit declared in kotlin.Array' type=kotlin.Unit origin=null
$this: CALL 'private final fun <get-data> (): kotlin.Array<kotlin.Any?> declared in <root>.ArrayMapImpl' type=kotlin.Array<kotlin.Any?> origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.ArrayMapImpl<T of <root>.ArrayMapImpl> declared in <root>.ArrayMapImpl.remove' type=<root>.ArrayMapImpl<T of <root>.ArrayMapImpl> origin=null
+24 -11
View File
@@ -132,7 +132,9 @@ internal class OneElementArrayMap<T : Any> : ArrayMap<T> {
<this>.<set-notVisited>(<set-?> = false)
return <this>.<get-value>()
}
else -> throw NoSuchElementException()
else -> { // BLOCK
throw NoSuchElementException()
}
}
}
@@ -194,9 +196,11 @@ internal class ArrayMapImpl<T : Any> : ArrayMap<T> {
<this>.ensureCapacity(index = index)
when {
EQEQ(arg0 = <this>.<get-data>().get(index = index), arg1 = null) -> { // BLOCK
val <unary>: Int = <this>.<get-size>()
<this>.<set-size>(<set-?> = <unary>.inc())
<unary>
{ // BLOCK
val <unary>: Int = <this>.<get-size>()
<this>.<set-size>(<set-?> = <unary>.inc())
<unary>
}
} /*~> Unit */
}
<this>.<get-data>().set(index = index, value = value)
@@ -226,18 +230,24 @@ internal class ArrayMapImpl<T : Any> : ArrayMap<T> {
protected override fun computeNext() {
{ // BLOCK
do{ // BLOCK
do// COMPOSITE {
{ // BLOCK
val <unary>: Int = <this>.<get-index>()
<this>.<set-index>(<set-?> = <unary>.inc())
<unary>
} while (when {
}
// } while (when {
less(arg0 = <this>.<get-index>(), arg1 = <this>.<get-data>().<get-size>()) -> EQEQ(arg0 = <this>.<get-data>().get(index = <this>.<get-index>()), arg1 = null)
else -> false
})
}
when {
greaterOrEqual(arg0 = <this>.<get-index>(), arg1 = <this>.<get-data>().<get-size>()) -> <this>.done()
else -> <this>.setNext(value = <this>.<get-data>().get(index = <this>.<get-index>()) as T)
greaterOrEqual(arg0 = <this>.<get-index>(), arg1 = <this>.<get-data>().<get-size>()) -> { // BLOCK
<this>.done()
}
else -> { // BLOCK
<this>.setNext(value = <this>.<get-data>().get(index = <this>.<get-index>()) as T)
}
}
}
@@ -250,9 +260,11 @@ internal class ArrayMapImpl<T : Any> : ArrayMap<T> {
fun remove(index: Int) {
when {
EQEQ(arg0 = <this>.<get-data>().get(index = index), arg1 = null).not() -> { // BLOCK
val <unary>: Int = <this>.<get-size>()
<this>.<set-size>(<set-?> = <unary>.dec())
<unary>
{ // BLOCK
val <unary>: Int = <this>.<get-size>()
<this>.<set-size>(<set-?> = <unary>.dec())
<unary>
}
} /*~> Unit */
}
<this>.<get-data>().set(index = index, value = null)
@@ -328,3 +340,4 @@ internal class ArrayMapImpl<T : Any> : ArrayMap<T> {
}
}
@@ -187,23 +187,24 @@ FILE fqName:<root> fileName:/DeepCopyIrTree.kt
VAR name:otherTypeParameter type:<root>.IrTypeParameter [val]
CALL 'public final fun component2 (): B of kotlin.Pair declared in kotlin.Pair' type=<root>.IrTypeParameter origin=COMPONENT_N(index=2)
$this: GET_VAR 'val tmp_1: kotlin.Pair<<root>.IrTypeParameter, <root>.IrTypeParameter> 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.mapTo, transform: kotlin.Function1<T of kotlin.collections.mapTo, R of kotlin.collections.mapTo>): C of kotlin.collections.mapTo declared in kotlin.collections' 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 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 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
BLOCK type=kotlin.collections.MutableList<<root>.IrType> origin=null
CALL 'public final fun mapTo <T, R, C> (destination: C of kotlin.collections.mapTo, transform: kotlin.Function1<T of kotlin.collections.mapTo, R of kotlin.collections.mapTo>): C of kotlin.collections.mapTo declared in kotlin.collections' 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 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 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 declared in kotlin.Any
@@ -59,10 +59,12 @@ class DeepCopyIrTreeWithSymbols {
val <destruct>: Pair<IrTypeParameter, IrTypeParameter> = <iterator>.next()
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)
}
{ // BLOCK
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)
}
)
}
}
}
}
@@ -1,168 +0,0 @@
FILE fqName:<root> fileName:/Modality.kt
CLASS INTERFACE name:Substitutable modality:ABSTRACT visibility:public superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Substitutable<T of <root>.Substitutable>
TYPE_PARAMETER name:T index:0 variance:out superTypes:[<root>.DeclarationDescriptorNonRoot] reified:false
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 declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override]
overridden:
public open fun hashCode (): kotlin.Int declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override]
overridden:
public open fun toString (): kotlin.String declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
CLASS CLASS name:ResolutionPart modality:ABSTRACT visibility:public superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.ResolutionPart
CONSTRUCTOR visibility:public <> () returnType:<root>.ResolutionPart [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:ResolutionPart modality:ABSTRACT visibility:public superTypes:[kotlin.Any]'
FUN name:process visibility:public modality:ABSTRACT <> ($this:<root>.ResolutionPart, $receiver:<root>.KotlinResolutionCandidate) returnType:kotlin.String
$this: VALUE_PARAMETER name:<this> type:<root>.ResolutionPart
$receiver: VALUE_PARAMETER name:<this> type:<root>.KotlinResolutionCandidate
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 declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override]
overridden:
public open fun hashCode (): kotlin.Int declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override]
overridden:
public open fun toString (): kotlin.String declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
CLASS CLASS name:KotlinResolutionCandidate modality:FINAL visibility:public superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.KotlinResolutionCandidate
CONSTRUCTOR visibility:public <> (resolvedCall:<root>.Atom) returnType:<root>.KotlinResolutionCandidate [primary]
VALUE_PARAMETER name:resolvedCall index:0 type:<root>.Atom
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:KotlinResolutionCandidate modality:FINAL visibility:public superTypes:[kotlin.Any]'
PROPERTY name:resolvedCall visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:resolvedCall type:<root>.Atom visibility:private [final]
EXPRESSION_BODY
GET_VAR 'resolvedCall: <root>.Atom declared in <root>.KotlinResolutionCandidate.<init>' type=<root>.Atom origin=INITIALIZE_PROPERTY_FROM_PARAMETER
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-resolvedCall> visibility:public modality:FINAL <> ($this:<root>.KotlinResolutionCandidate) returnType:<root>.Atom
correspondingProperty: PROPERTY name:resolvedCall visibility:public modality:FINAL [val]
$this: VALUE_PARAMETER name:<this> type:<root>.KotlinResolutionCandidate
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-resolvedCall> (): <root>.Atom declared in <root>.KotlinResolutionCandidate'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:resolvedCall type:<root>.Atom visibility:private [final]' type=<root>.Atom origin=null
receiver: GET_VAR '<this>: <root>.KotlinResolutionCandidate declared in <root>.KotlinResolutionCandidate.<get-resolvedCall>' type=<root>.KotlinResolutionCandidate 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 declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override]
overridden:
public open fun hashCode (): kotlin.Int declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override]
overridden:
public open fun toString (): kotlin.String declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
CLASS CLASS name:Atom modality:FINAL visibility:public superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Atom
CONSTRUCTOR visibility:public <> (candidateDescriptor:<root>.CallableDescriptor) returnType:<root>.Atom [primary]
VALUE_PARAMETER name:candidateDescriptor index:0 type:<root>.CallableDescriptor
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Atom modality:FINAL visibility:public superTypes:[kotlin.Any]'
PROPERTY name:candidateDescriptor visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:candidateDescriptor type:<root>.CallableDescriptor visibility:private [final]
EXPRESSION_BODY
GET_VAR 'candidateDescriptor: <root>.CallableDescriptor declared in <root>.Atom.<init>' type=<root>.CallableDescriptor origin=INITIALIZE_PROPERTY_FROM_PARAMETER
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-candidateDescriptor> visibility:public modality:FINAL <> ($this:<root>.Atom) returnType:<root>.CallableDescriptor
correspondingProperty: PROPERTY name:candidateDescriptor visibility:public modality:FINAL [val]
$this: VALUE_PARAMETER name:<this> type:<root>.Atom
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-candidateDescriptor> (): <root>.CallableDescriptor declared in <root>.Atom'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:candidateDescriptor type:<root>.CallableDescriptor visibility:private [final]' type=<root>.CallableDescriptor origin=null
receiver: GET_VAR '<this>: <root>.Atom declared in <root>.Atom.<get-candidateDescriptor>' type=<root>.Atom 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 declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override]
overridden:
public open fun hashCode (): kotlin.Int declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override]
overridden:
public open fun toString (): kotlin.String declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
CLASS OBJECT name:Owner modality:FINAL visibility:public superTypes:[<root>.ResolutionPart]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Owner
CONSTRUCTOR visibility:private <> () returnType:<root>.Owner [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () declared in <root>.ResolutionPart'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Owner modality:FINAL visibility:public superTypes:[<root>.ResolutionPart]'
FUN name:process visibility:public modality:OPEN <> ($this:<root>.Owner, $receiver:<root>.KotlinResolutionCandidate) returnType:kotlin.String
overridden:
public abstract fun process (): kotlin.String declared in <root>.ResolutionPart
$this: VALUE_PARAMETER name:<this> type:<root>.Owner
$receiver: VALUE_PARAMETER name:<this> type:<root>.KotlinResolutionCandidate
BLOCK_BODY
VAR name:candidateDescriptor type:<root>.CallableDescriptor [val]
CALL 'public final fun <get-candidateDescriptor> (): <root>.CallableDescriptor declared in <root>.Atom' type=<root>.CallableDescriptor origin=GET_PROPERTY
$this: CALL 'public final fun <get-resolvedCall> (): <root>.Atom declared in <root>.KotlinResolutionCandidate' type=<root>.Atom origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.KotlinResolutionCandidate declared in <root>.Owner.process' type=<root>.KotlinResolutionCandidate origin=null
WHEN type=kotlin.Unit origin=IF
BRANCH
if: WHEN type=kotlin.Boolean origin=ANDAND
BRANCH
if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=<root>.MemberDescriptor
GET_VAR 'val candidateDescriptor: <root>.CallableDescriptor declared in <root>.Owner.process' type=<root>.CallableDescriptor origin=null
then: CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ
$this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ
arg0: CALL 'public abstract fun getModality (): @[FlexibleNullability] <root>.Modality? declared in <root>.MemberDescriptor' type=@[FlexibleNullability] <root>.Modality? origin=GET_PROPERTY
$this: TYPE_OP type=<root>.MemberDescriptor origin=IMPLICIT_CAST typeOperand=<root>.MemberDescriptor
GET_VAR 'val candidateDescriptor: <root>.CallableDescriptor declared in <root>.Owner.process' type=<root>.CallableDescriptor origin=null
arg1: CONST Null type=kotlin.Nothing? value=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CONST Boolean type=kotlin.Boolean value=false
then: RETURN type=kotlin.Nothing from='public open fun process (): kotlin.String declared in <root>.Owner'
CONST String type=kotlin.String value="OK"
RETURN type=kotlin.Nothing from='public open fun process (): kotlin.String declared in <root>.Owner'
CONST String type=kotlin.String value="FAIL"
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 declared in <root>.ResolutionPart
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override]
overridden:
public open fun hashCode (): kotlin.Int declared in <root>.ResolutionPart
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override]
overridden:
public open fun toString (): kotlin.String declared in <root>.ResolutionPart
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
CLASS OBJECT name:Final modality:FINAL visibility:public superTypes:[<root>.Modality]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Final
CONSTRUCTOR visibility:private <> () returnType:<root>.Final [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Final modality:FINAL visibility:public superTypes:[<root>.Modality]'
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 declared in <root>.Modality
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override]
overridden:
public open fun hashCode (): kotlin.Int declared in <root>.Modality
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override]
overridden:
public open fun toString (): kotlin.String declared in <root>.Modality
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
@@ -1,69 +0,0 @@
interface Substitutable<out T : DeclarationDescriptorNonRoot> {
}
abstract class ResolutionPart {
constructor() /* primary */ {
super/*Any*/()
/* <init>() */
}
abstract fun KotlinResolutionCandidate.process(): String
}
class KotlinResolutionCandidate {
constructor(resolvedCall: Atom) /* primary */ {
super/*Any*/()
/* <init>() */
}
val resolvedCall: Atom
field = resolvedCall
get
}
class Atom {
constructor(candidateDescriptor: CallableDescriptor) /* primary */ {
super/*Any*/()
/* <init>() */
}
val candidateDescriptor: CallableDescriptor
field = candidateDescriptor
get
}
object Owner : ResolutionPart {
private constructor() /* primary */ {
super/*ResolutionPart*/()
/* <init>() */
}
override fun KotlinResolutionCandidate.process(): String {
val candidateDescriptor: CallableDescriptor = <this>.<get-resolvedCall>().<get-candidateDescriptor>()
when {
when {
candidateDescriptor is MemberDescriptor -> EQEQ(arg0 = candidateDescriptor /*as MemberDescriptor */.getModality(), arg1 = null).not()
else -> false
} -> return "OK"
}
return "FAIL"
}
}
object Final : Modality {
private constructor() /* primary */ {
super/*Any*/()
/* <init>() */
}
}
+1
View File
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// TARGET_BACKEND: JVM
// FILE: Modality.java
public interface Modality
+6 -5
View File
@@ -30,11 +30,12 @@ FILE fqName:<root> fileName:/Box.kt
BRANCH
if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=<root>.Foo.Buz
GET_VAR 'var foo: <root>.Foo declared in <root>.Box.<get-str>' type=<root>.Foo origin=null
then: RETURN type=kotlin.Nothing from='public final fun <get-str> (): kotlin.String declared in <root>.Box'
TYPE_OP type=kotlin.String origin=IMPLICIT_NOTNULL typeOperand=kotlin.String
GET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:str type:@[FlexibleNullability] kotlin.String? visibility:public' type=@[FlexibleNullability] kotlin.String? origin=GET_PROPERTY
receiver: TYPE_OP type=<root>.Foo.Buz origin=IMPLICIT_CAST typeOperand=<root>.Foo.Buz
GET_VAR 'var foo: <root>.Foo declared in <root>.Box.<get-str>' type=<root>.Foo origin=null
then: BLOCK type=kotlin.Unit origin=null
RETURN type=kotlin.Nothing from='public final fun <get-str> (): kotlin.String declared in <root>.Box'
TYPE_OP type=kotlin.String origin=IMPLICIT_NOTNULL typeOperand=kotlin.String
GET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:str type:@[FlexibleNullability] kotlin.String? visibility:public' type=@[FlexibleNullability] kotlin.String? origin=GET_PROPERTY
receiver: TYPE_OP type=<root>.Foo.Buz origin=IMPLICIT_CAST typeOperand=<root>.Foo.Buz
GET_VAR 'var foo: <root>.Foo declared in <root>.Box.<get-str>' type=<root>.Foo origin=null
RETURN type=kotlin.Nothing from='public final fun <get-str> (): kotlin.String declared in <root>.Box'
CONST String type=kotlin.String value=""
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
+4 -1
View File
@@ -13,9 +13,12 @@ class Box<out T : Foo> {
get(): String {
var foo: Foo = <this>.<get-foo>()
when {
foo is Buz -> return foo /*as Buz */.#str /*!! String */
foo is Buz -> { // BLOCK
return foo /*as Buz */.#str /*!! String */
}
}
return ""
}
}
@@ -1,50 +0,0 @@
FILE fqName:<root> fileName:/reflectGetOnNullableTypeAlias.kt
TYPEALIAS name:PropAlias visibility:private expandedType:kotlin.reflect.KProperty1<T of <root>.PropAlias, kotlin.Any?>?
TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false
FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String
BLOCK_BODY
VAR name:backRefProp type:kotlin.reflect.KProperty1<<root>.Foo, kotlin.Any?>? [val]
PROPERTY_REFERENCE 'public final bar: kotlin.String' field=null getter='public final fun <get-bar> (): kotlin.String declared in <root>.Foo' setter=null type=kotlin.reflect.KProperty1<<root>.Foo, kotlin.String> origin=null
WHEN type=kotlin.Unit origin=IF
BRANCH
if: CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ
$this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ
arg0: GET_VAR 'val backRefProp: kotlin.reflect.KProperty1<<root>.Foo, kotlin.Any?>? declared in <root>.box' type=kotlin.reflect.KProperty1<<root>.Foo, kotlin.Any?>? origin=null
arg1: CONST Null type=kotlin.Nothing? value=null
then: RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in <root>'
TYPE_OP type=kotlin.String origin=CAST typeOperand=kotlin.String
CALL 'public abstract fun get (receiver: T of kotlin.reflect.KProperty1): V of kotlin.reflect.KProperty1 declared in kotlin.reflect.KProperty1' type=kotlin.Any? origin=null
$this: GET_VAR 'val backRefProp: kotlin.reflect.KProperty1<<root>.Foo, kotlin.Any?>? declared in <root>.box' type=kotlin.reflect.KProperty1<<root>.Foo, kotlin.Any?>? origin=null
receiver: CONSTRUCTOR_CALL 'public constructor <init> () declared in <root>.Foo' type=<root>.Foo origin=null
RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in <root>'
CONST String type=kotlin.String value="FAIL"
CLASS CLASS name:Foo modality:FINAL visibility:public superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Foo
CONSTRUCTOR visibility:public <> () returnType:<root>.Foo [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Foo modality:FINAL visibility:public superTypes:[kotlin.Any]'
PROPERTY name:bar visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:bar type:kotlin.String visibility:private [final]
EXPRESSION_BODY
CONST String type=kotlin.String value="OK"
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-bar> visibility:public modality:FINAL <> ($this:<root>.Foo) returnType:kotlin.String
correspondingProperty: PROPERTY name:bar visibility:public modality:FINAL [val]
$this: VALUE_PARAMETER name:<this> type:<root>.Foo
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-bar> (): kotlin.String declared in <root>.Foo'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:bar type:kotlin.String visibility:private [final]' type=kotlin.String origin=null
receiver: GET_VAR '<this>: <root>.Foo declared in <root>.Foo.<get-bar>' type=<root>.Foo 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 declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override]
overridden:
public open fun hashCode (): kotlin.Int declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override]
overridden:
public open fun toString (): kotlin.String declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
@@ -1,21 +0,0 @@
private typealias PropAlias<T : Any?> = KProperty1<T, Any?>?
fun box(): String {
val backRefProp: KProperty1<Foo, Any?>? = Foo::bar
when {
EQEQ(arg0 = backRefProp, arg1 = null).not() -> return backRefProp.get(receiver = Foo()) as String
}
return "FAIL"
}
class Foo {
constructor() /* primary */ {
super/*Any*/()
/* <init>() */
}
val bar: String
field = "OK"
get
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// SKIP_KLIB_TEST
// WITH_REFLECT