FIR2IR: Do not add implicit casts for types with different nullability

For smart casts, elvises, etc., there are no implicit casts in psi2fir
in changed test data
This commit is contained in:
Denis.Zharkov
2021-01-28 16:38:41 +03:00
parent 5c62ee4ba8
commit 1e0d9f4075
46 changed files with 106 additions and 264 deletions
@@ -24,6 +24,7 @@ import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.expressions.*
import org.jetbrains.kotlin.ir.expressions.impl.IrTypeOperatorCallImpl
import org.jetbrains.kotlin.ir.types.IrType
import org.jetbrains.kotlin.ir.types.makeNotNull
import org.jetbrains.kotlin.ir.types.removeAnnotations
import org.jetbrains.kotlin.ir.types.withHasQuestionMark
import org.jetbrains.kotlin.ir.util.classId
@@ -314,7 +315,8 @@ class Fir2IrImplicitCastInserter(
}
internal fun implicitCastOrExpression(original: IrExpression, castType: IrType): IrExpression {
return original.takeIf { it.type == castType } ?: implicitCast(original, castType)
if (original.type.makeNotNull() == castType.makeNotNull()) return original
return implicitCast(original, castType)
}
private fun implicitCast(original: IrExpression, castType: IrType): IrExpression {
@@ -22,8 +22,8 @@ fun test2() {
}
<set-x>(<set-?> = 0)
val <unary>: Int = <get-x>() /*as Int */
val <unary>: Int = <get-x>()
<set-x>(<set-?> = <unary>.inc())
<unary> /*~> Unit */
<set-x>(<set-?> = <get-x>() /*as Int */.plus(other = 1))
<set-x>(<set-?> = <get-x>().plus(other = 1))
}
@@ -48,8 +48,7 @@ FILE fqName:<root> fileName:/localDelegatedProperties.kt
CALL 'local final fun <set-x> (<set-?>: kotlin.Int?): kotlin.Unit declared in <root>.test2' type=kotlin.Unit origin=EQ
<set-?>: CONST Int type=kotlin.Int value=0
VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.Int [val]
TYPE_OP type=kotlin.Int origin=IMPLICIT_CAST typeOperand=kotlin.Int
CALL 'local final fun <get-x> (): kotlin.Int? declared in <root>.test2' type=kotlin.Int? origin=GET_LOCAL_PROPERTY
CALL 'local final fun <get-x> (): kotlin.Int? declared in <root>.test2' type=kotlin.Int? origin=GET_LOCAL_PROPERTY
CALL 'local final fun <set-x> (<set-?>: kotlin.Int?): kotlin.Unit declared in <root>.test2' type=kotlin.Unit origin=EQ
<set-?>: CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
$this: GET_VAR 'val tmp_0: kotlin.Int [val] declared in <root>.test2' type=kotlin.Int origin=null
@@ -57,6 +56,5 @@ FILE fqName:<root> fileName:/localDelegatedProperties.kt
GET_VAR 'val tmp_0: kotlin.Int [val] declared in <root>.test2' type=kotlin.Int origin=null
CALL 'local final fun <set-x> (<set-?>: kotlin.Int?): kotlin.Unit declared in <root>.test2' type=kotlin.Unit origin=EQ
<set-?>: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
$this: TYPE_OP type=kotlin.Int origin=IMPLICIT_CAST typeOperand=kotlin.Int
CALL 'local final fun <get-x> (): kotlin.Int? declared in <root>.test2' type=kotlin.Int? origin=GET_LOCAL_PROPERTY
$this: CALL 'local final fun <get-x> (): kotlin.Int? declared in <root>.test2' type=kotlin.Int? origin=GET_LOCAL_PROPERTY
other: CONST Int type=kotlin.Int value=1
@@ -7,7 +7,7 @@ fun test2(a: Any?): Int {
val tmp0_safe_receiver: Any? = a
when {
EQEQ(arg0 = tmp0_safe_receiver, arg1 = null) -> null
else -> tmp0_safe_receiver /*as Any */.hashCode()
else -> tmp0_safe_receiver.hashCode()
}
})
}
+1 -2
View File
@@ -24,8 +24,7 @@ FILE fqName:<root> fileName:/bangbang.kt
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Any' type=kotlin.Int origin=null
$this: TYPE_OP type=kotlin.Any origin=IMPLICIT_CAST typeOperand=kotlin.Any
GET_VAR 'val tmp_0: kotlin.Any? [val] declared in <root>.test2' type=kotlin.Any? origin=null
$this: GET_VAR 'val tmp_0: kotlin.Any? [val] declared in <root>.test2' type=kotlin.Any? origin=null
FUN name:test3 visibility:public modality:FINAL <X> (a:X of <root>.test3) returnType:X of <root>.test3
TYPE_PARAMETER name:X index:0 variance: superTypes:[kotlin.Any?]
VALUE_PARAMETER name:a index:0 type:X of <root>.test3
@@ -4,7 +4,7 @@ fun test1(c: Boolean?) {
val <elvis>: Boolean? = c
when {
EQEQ(arg0 = <elvis>, arg1 = null) -> break@L
else -> <elvis> /*as Boolean */
else -> <elvis>
}
}) { // BLOCK
}
@@ -17,7 +17,7 @@ fun test2(c: Boolean?) {
val <elvis>: Boolean? = c
when {
EQEQ(arg0 = <elvis>, arg1 = null) -> continue@L
else -> <elvis> /*as Boolean */
else -> <elvis>
}
}) { // BLOCK
}
@@ -31,7 +31,7 @@ fun test3(ss: List<String>?) {
val <elvis>: List<String>? = ss
when {
EQEQ(arg0 = <elvis>, arg1 = null) -> continue@L
else -> <elvis> /*as List<String> */
else -> <elvis>
}
}.iterator()
L2@ while (<iterator>.hasNext()) { // BLOCK
@@ -48,7 +48,7 @@ fun test4(ss: List<String>?) {
val <elvis>: List<String>? = ss
when {
EQEQ(arg0 = <elvis>, arg1 = null) -> break@L
else -> <elvis> /*as List<String> */
else -> <elvis>
}
}.iterator()
L2@ while (<iterator>.hasNext()) { // BLOCK
@@ -17,8 +17,7 @@ FILE fqName:<root> fileName:/breakContinueInLoopHeader.kt
then: BREAK label=L loop.label=L
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: TYPE_OP type=kotlin.Boolean origin=IMPLICIT_CAST typeOperand=kotlin.Boolean
GET_VAR 'val tmp_0: kotlin.Boolean? [val] declared in <root>.test1' type=kotlin.Boolean? origin=null
then: GET_VAR 'val tmp_0: kotlin.Boolean? [val] declared in <root>.test1' type=kotlin.Boolean? origin=null
body: BLOCK type=kotlin.Unit origin=null
FUN name:test2 visibility:public modality:FINAL <> (c:kotlin.Boolean?) returnType:kotlin.Unit
VALUE_PARAMETER name:c index:0 type:kotlin.Boolean?
@@ -38,8 +37,7 @@ FILE fqName:<root> fileName:/breakContinueInLoopHeader.kt
then: CONTINUE label=L loop.label=L
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: TYPE_OP type=kotlin.Boolean origin=IMPLICIT_CAST typeOperand=kotlin.Boolean
GET_VAR 'val tmp_1: kotlin.Boolean? [val] declared in <root>.test2' type=kotlin.Boolean? origin=null
then: GET_VAR 'val tmp_1: kotlin.Boolean? [val] declared in <root>.test2' type=kotlin.Boolean? origin=null
body: BLOCK type=kotlin.Unit origin=null
FUN name:test3 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>?
@@ -61,8 +59,7 @@ FILE fqName:<root> fileName:/breakContinueInLoopHeader.kt
then: CONTINUE label=L loop.label=L
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: TYPE_OP type=kotlin.collections.List<kotlin.String> origin=IMPLICIT_CAST typeOperand=kotlin.collections.List<kotlin.String>
GET_VAR 'val tmp_3: kotlin.collections.List<kotlin.String>? [val] declared in <root>.test3' type=kotlin.collections.List<kotlin.String>? origin=null
then: GET_VAR 'val tmp_3: kotlin.collections.List<kotlin.String>? [val] declared in <root>.test3' type=kotlin.collections.List<kotlin.String>? origin=null
WHILE label=L2 origin=FOR_LOOP_INNER_WHILE
condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT
$this: GET_VAR 'val tmp_2: kotlin.collections.Iterator<kotlin.String> [val] declared in <root>.test3' type=kotlin.collections.Iterator<kotlin.String> origin=null
@@ -90,8 +87,7 @@ FILE fqName:<root> fileName:/breakContinueInLoopHeader.kt
then: BREAK label=L loop.label=L
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: TYPE_OP type=kotlin.collections.List<kotlin.String> origin=IMPLICIT_CAST typeOperand=kotlin.collections.List<kotlin.String>
GET_VAR 'val tmp_5: kotlin.collections.List<kotlin.String>? [val] declared in <root>.test4' type=kotlin.collections.List<kotlin.String>? origin=null
then: GET_VAR 'val tmp_5: kotlin.collections.List<kotlin.String>? [val] declared in <root>.test4' type=kotlin.collections.List<kotlin.String>? origin=null
WHILE label=L2 origin=FOR_LOOP_INNER_WHILE
condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT
$this: GET_VAR 'val tmp_4: kotlin.collections.Iterator<kotlin.String> [val] declared in <root>.test4' type=kotlin.collections.Iterator<kotlin.String> origin=null
@@ -23,22 +23,22 @@ fun test(nc: C?): C? {
val tmp0_safe_receiver: C? = nc
when {
EQEQ(arg0 = tmp0_safe_receiver, arg1 = null) -> null
else -> tmp0_safe_receiver /*as C */.foo()
else -> tmp0_safe_receiver.foo()
}
}
when {
EQEQ(arg0 = tmp1_safe_receiver, arg1 = null) -> null
else -> tmp1_safe_receiver /*as C */.bar()
else -> tmp1_safe_receiver.bar()
}
}
when {
EQEQ(arg0 = tmp2_safe_receiver, arg1 = null) -> null
else -> tmp2_safe_receiver /*as C */.foo()
else -> tmp2_safe_receiver.foo()
}
}
when {
EQEQ(arg0 = tmp3_safe_receiver, arg1 = null) -> null
else -> tmp3_safe_receiver /*as C */.foo()
else -> tmp3_safe_receiver.foo()
}
}
}
@@ -50,8 +50,7 @@ FILE fqName:<root> fileName:/chainOfSafeCalls.kt
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CALL 'public final fun foo (): <root>.C declared in <root>.C' type=<root>.C origin=null
$this: TYPE_OP type=<root>.C origin=IMPLICIT_CAST typeOperand=<root>.C
GET_VAR 'val tmp_3: <root>.C? [val] declared in <root>.test' type=<root>.C? origin=null
$this: GET_VAR 'val tmp_3: <root>.C? [val] declared in <root>.test' type=<root>.C? origin=null
WHEN type=<root>.C? origin=null
BRANCH
if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ
@@ -61,8 +60,7 @@ FILE fqName:<root> fileName:/chainOfSafeCalls.kt
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CALL 'public final fun bar (): <root>.C? declared in <root>.C' type=<root>.C? origin=null
$this: TYPE_OP type=<root>.C origin=IMPLICIT_CAST typeOperand=<root>.C
GET_VAR 'val tmp_2: <root>.C? [val] declared in <root>.test' type=<root>.C? origin=null
$this: GET_VAR 'val tmp_2: <root>.C? [val] declared in <root>.test' type=<root>.C? origin=null
WHEN type=<root>.C? origin=null
BRANCH
if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ
@@ -72,8 +70,7 @@ FILE fqName:<root> fileName:/chainOfSafeCalls.kt
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CALL 'public final fun foo (): <root>.C declared in <root>.C' type=<root>.C origin=null
$this: TYPE_OP type=<root>.C origin=IMPLICIT_CAST typeOperand=<root>.C
GET_VAR 'val tmp_1: <root>.C? [val] declared in <root>.test' type=<root>.C? origin=null
$this: GET_VAR 'val tmp_1: <root>.C? [val] declared in <root>.test' type=<root>.C? origin=null
WHEN type=<root>.C? origin=null
BRANCH
if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ
@@ -83,5 +80,4 @@ FILE fqName:<root> fileName:/chainOfSafeCalls.kt
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CALL 'public final fun foo (): <root>.C declared in <root>.C' type=<root>.C origin=null
$this: TYPE_OP type=<root>.C origin=IMPLICIT_CAST typeOperand=<root>.C
GET_VAR 'val tmp_0: <root>.C? [val] declared in <root>.test' type=<root>.C? origin=null
$this: GET_VAR 'val tmp_0: <root>.C? [val] declared in <root>.test' type=<root>.C? origin=null
@@ -14,14 +14,14 @@ fun test3() {
val tmp0_safe_receiver: PrintStream? = #out
when {
EQEQ(arg0 = tmp0_safe_receiver, arg1 = null) -> null
else -> tmp0_safe_receiver /*as @FlexibleNullability PrintStream */.println(p0 = "Hello,")
else -> tmp0_safe_receiver.println(p0 = "Hello,")
}
} /*~> Unit */
{ // BLOCK
val tmp1_safe_receiver: PrintStream? = #out
when {
EQEQ(arg0 = tmp1_safe_receiver, arg1 = null) -> null
else -> tmp1_safe_receiver /*as @FlexibleNullability PrintStream */.println(p0 = "world!")
else -> tmp1_safe_receiver.println(p0 = "world!")
}
} /*~> Unit */
}
@@ -34,8 +34,7 @@ FILE fqName:<root> fileName:/coercionToUnit.kt
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CALL 'public open fun println (p0: kotlin.String?): kotlin.Unit declared in java.io.PrintStream' type=kotlin.Unit origin=null
$this: TYPE_OP type=@[FlexibleNullability] java.io.PrintStream origin=IMPLICIT_CAST typeOperand=@[FlexibleNullability] java.io.PrintStream
GET_VAR 'val tmp_0: java.io.PrintStream? [val] declared in <root>.test3' type=java.io.PrintStream? origin=null
$this: GET_VAR 'val tmp_0: java.io.PrintStream? [val] declared in <root>.test3' type=java.io.PrintStream? origin=null
p0: CONST String type=kotlin.String value="Hello,"
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
BLOCK type=kotlin.Unit? origin=SAFE_CALL
@@ -50,6 +49,5 @@ FILE fqName:<root> fileName:/coercionToUnit.kt
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CALL 'public open fun println (p0: kotlin.String?): kotlin.Unit declared in java.io.PrintStream' type=kotlin.Unit origin=null
$this: TYPE_OP type=@[FlexibleNullability] java.io.PrintStream origin=IMPLICIT_CAST typeOperand=@[FlexibleNullability] java.io.PrintStream
GET_VAR 'val tmp_1: java.io.PrintStream? [val] declared in <root>.test3' type=java.io.PrintStream? origin=null
$this: GET_VAR 'val tmp_1: java.io.PrintStream? [val] declared in <root>.test3' type=java.io.PrintStream? origin=null
p0: CONST String type=kotlin.String value="world!"
@@ -7,7 +7,7 @@ fun lengthN(s: String?): Int? {
val tmp0_safe_receiver: String? = s
when {
EQEQ(arg0 = tmp0_safe_receiver, arg1 = null) -> null
else -> tmp0_safe_receiver /*as String */.<get-length>()
else -> tmp0_safe_receiver.<get-length>()
}
}
}
+1 -2
View File
@@ -21,5 +21,4 @@ FILE fqName:<root> fileName:/dotQualified.kt
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CALL 'public open fun <get-length> (): kotlin.Int declared in kotlin.String' type=kotlin.Int origin=GET_PROPERTY
$this: TYPE_OP type=kotlin.String origin=IMPLICIT_CAST typeOperand=kotlin.String
GET_VAR 'val tmp_0: kotlin.String? [val] declared in <root>.lengthN' type=kotlin.String? origin=null
$this: GET_VAR 'val tmp_0: kotlin.String? [val] declared in <root>.lengthN' type=kotlin.String? origin=null
+5 -5
View File
@@ -11,7 +11,7 @@ fun test1(a: Any?, b: Any): Any {
val <elvis>: Any? = a
when {
EQEQ(arg0 = <elvis>, arg1 = null) -> b
else -> <elvis> /*as Any */
else -> <elvis>
}
}
}
@@ -21,7 +21,7 @@ fun test2(a: String?, b: Any): Any {
val <elvis>: String? = a
when {
EQEQ(arg0 = <elvis>, arg1 = null) -> b
else -> <elvis> /*as String */
else -> <elvis>
}
}
}
@@ -37,7 +37,7 @@ fun test3(a: Any?, b: Any?): String {
val <elvis>: String? = a /*as String? */
when {
EQEQ(arg0 = <elvis>, arg1 = null) -> b /*as String */
else -> <elvis> /*as String */
else -> <elvis>
}
}
}
@@ -47,7 +47,7 @@ fun test4(x: Any): Any {
val <elvis>: Any? = <get-p>()
when {
EQEQ(arg0 = <elvis>, arg1 = null) -> x
else -> <elvis> /*as Any */
else -> <elvis>
}
}
}
@@ -57,7 +57,7 @@ fun test5(x: Any): Any {
val <elvis>: Any? = foo()
when {
EQEQ(arg0 = <elvis>, arg1 = null) -> x
else -> <elvis> /*as Any */
else -> <elvis>
}
}
}
+5 -10
View File
@@ -28,8 +28,7 @@ FILE fqName:<root> fileName:/elvis.kt
then: GET_VAR 'b: kotlin.Any declared in <root>.test1' type=kotlin.Any origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: TYPE_OP type=kotlin.Any origin=IMPLICIT_CAST typeOperand=kotlin.Any
GET_VAR 'val tmp_0: kotlin.Any? [val] declared in <root>.test1' type=kotlin.Any? origin=null
then: GET_VAR 'val tmp_0: kotlin.Any? [val] declared in <root>.test1' type=kotlin.Any? origin=null
FUN name:test2 visibility:public modality:FINAL <> (a:kotlin.String?, b:kotlin.Any) returnType:kotlin.Any
VALUE_PARAMETER name:a index:0 type:kotlin.String?
VALUE_PARAMETER name:b index:1 type:kotlin.Any
@@ -46,8 +45,7 @@ FILE fqName:<root> fileName:/elvis.kt
then: GET_VAR 'b: kotlin.Any declared in <root>.test2' type=kotlin.Any origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: TYPE_OP type=kotlin.String origin=IMPLICIT_CAST typeOperand=kotlin.String
GET_VAR 'val tmp_1: kotlin.String? [val] declared in <root>.test2' type=kotlin.String? origin=null
then: GET_VAR 'val tmp_1: kotlin.String? [val] declared in <root>.test2' type=kotlin.String? origin=null
FUN name:test3 visibility:public modality:FINAL <> (a:kotlin.Any?, b:kotlin.Any?) returnType:kotlin.String
VALUE_PARAMETER name:a index:0 type:kotlin.Any?
VALUE_PARAMETER name:b index:1 type:kotlin.Any?
@@ -78,8 +76,7 @@ FILE fqName:<root> fileName:/elvis.kt
GET_VAR 'b: kotlin.Any? declared in <root>.test3' type=kotlin.Any? origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: TYPE_OP type=kotlin.String origin=IMPLICIT_CAST typeOperand=kotlin.String
GET_VAR 'val tmp_2: kotlin.String? [val] declared in <root>.test3' type=kotlin.String? origin=null
then: GET_VAR 'val tmp_2: kotlin.String? [val] declared in <root>.test3' type=kotlin.String? origin=null
FUN name:test4 visibility:public modality:FINAL <> (x:kotlin.Any) returnType:kotlin.Any
VALUE_PARAMETER name:x index:0 type:kotlin.Any
BLOCK_BODY
@@ -95,8 +92,7 @@ FILE fqName:<root> fileName:/elvis.kt
then: GET_VAR 'x: kotlin.Any declared in <root>.test4' type=kotlin.Any origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: TYPE_OP type=kotlin.Any origin=IMPLICIT_CAST typeOperand=kotlin.Any
GET_VAR 'val tmp_3: kotlin.Any? [val] declared in <root>.test4' type=kotlin.Any? origin=null
then: GET_VAR 'val tmp_3: kotlin.Any? [val] declared in <root>.test4' type=kotlin.Any? origin=null
FUN name:test5 visibility:public modality:FINAL <> (x:kotlin.Any) returnType:kotlin.Any
VALUE_PARAMETER name:x index:0 type:kotlin.Any
BLOCK_BODY
@@ -112,5 +108,4 @@ FILE fqName:<root> fileName:/elvis.kt
then: GET_VAR 'x: kotlin.Any declared in <root>.test5' type=kotlin.Any origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: TYPE_OP type=kotlin.Any origin=IMPLICIT_CAST typeOperand=kotlin.Any
GET_VAR 'val tmp_4: kotlin.Any? [val] declared in <root>.test5' type=kotlin.Any? origin=null
then: GET_VAR 'val tmp_4: kotlin.Any? [val] declared in <root>.test5' type=kotlin.Any? origin=null
@@ -1,33 +0,0 @@
fun test1(x: String?): Int {
return when {
EQEQ(arg0 = x, arg1 = null) -> 0
else -> x /*as String */.<get-length>()
}
}
fun <T : CharSequence?> test2(x: T): Int {
return when {
EQEQ(arg0 = x, arg1 = null) -> 0
else -> x.<get-length>()
}
}
inline fun <reified T : CharSequence?> test3(x: Any): Int {
return when {
x !is T -> 0
else -> x /*as T */.<get-length>()
}
}
inline fun <reified T : CharSequence> test4(x: Any?): Int {
return when {
x !is T -> 0
else -> x /*as T */.<get-length>()
}
}
fun <T : S?, S : Any?> test5(x: T, fn: Function1<S, Unit>) {
when {
EQEQ(arg0 = x, arg1 = null).not() -> fn.invoke(p1 = x)
}
}
@@ -1,76 +0,0 @@
FILE fqName:<root> fileName:/implicitCastToNonNull.kt
FUN name:test1 visibility:public modality:FINAL <> (x:kotlin.String?) returnType:kotlin.Int
VALUE_PARAMETER name:x index:0 type:kotlin.String?
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun test1 (x: kotlin.String?): kotlin.Int declared in <root>'
WHEN type=kotlin.Int origin=IF
BRANCH
if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ
arg0: GET_VAR 'x: kotlin.String? declared in <root>.test1' type=kotlin.String? origin=null
arg1: CONST Null type=kotlin.Nothing? value=null
then: CONST Int type=kotlin.Int value=0
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CALL 'public open fun <get-length> (): kotlin.Int declared in kotlin.String' type=kotlin.Int origin=GET_PROPERTY
$this: TYPE_OP type=kotlin.String origin=IMPLICIT_CAST typeOperand=kotlin.String
GET_VAR 'x: kotlin.String? declared in <root>.test1' type=kotlin.String? origin=null
FUN name:test2 visibility:public modality:FINAL <T> (x:T of <root>.test2) returnType:kotlin.Int
TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.CharSequence?]
VALUE_PARAMETER name:x index:0 type:T of <root>.test2
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun test2 <T> (x: T of <root>.test2): kotlin.Int declared in <root>'
WHEN type=kotlin.Int origin=IF
BRANCH
if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ
arg0: GET_VAR 'x: T of <root>.test2 declared in <root>.test2' type=T of <root>.test2 origin=null
arg1: CONST Null type=kotlin.Nothing? value=null
then: CONST Int type=kotlin.Int value=0
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CALL 'public abstract fun <get-length> (): kotlin.Int declared in kotlin.CharSequence' type=kotlin.Int origin=GET_PROPERTY
$this: GET_VAR 'x: T of <root>.test2 declared in <root>.test2' type=T of <root>.test2 origin=null
FUN name:test3 visibility:public modality:FINAL <T> (x:kotlin.Any) returnType:kotlin.Int [inline]
TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.CharSequence?]
VALUE_PARAMETER name:x index:0 type:kotlin.Any
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun test3 <T> (x: kotlin.Any): kotlin.Int [inline] declared in <root>'
WHEN type=kotlin.Int origin=IF
BRANCH
if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=T of <root>.test3
GET_VAR 'x: kotlin.Any declared in <root>.test3' type=kotlin.Any origin=null
then: CONST Int type=kotlin.Int value=0
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CALL 'public abstract fun <get-length> (): kotlin.Int declared in kotlin.CharSequence' type=kotlin.Int origin=GET_PROPERTY
$this: TYPE_OP type=T of <root>.test3 origin=IMPLICIT_CAST typeOperand=T of <root>.test3
GET_VAR 'x: kotlin.Any declared in <root>.test3' type=kotlin.Any origin=null
FUN name:test4 visibility:public modality:FINAL <T> (x:kotlin.Any?) returnType:kotlin.Int [inline]
TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.CharSequence]
VALUE_PARAMETER name:x index:0 type:kotlin.Any?
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun test4 <T> (x: kotlin.Any?): kotlin.Int [inline] declared in <root>'
WHEN type=kotlin.Int origin=IF
BRANCH
if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=T of <root>.test4
GET_VAR 'x: kotlin.Any? declared in <root>.test4' type=kotlin.Any? origin=null
then: CONST Int type=kotlin.Int value=0
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CALL 'public abstract fun <get-length> (): kotlin.Int declared in kotlin.CharSequence' type=kotlin.Int origin=GET_PROPERTY
$this: TYPE_OP type=T of <root>.test4 origin=IMPLICIT_CAST typeOperand=T of <root>.test4
GET_VAR 'x: kotlin.Any? declared in <root>.test4' type=kotlin.Any? origin=null
FUN name:test5 visibility:public modality:FINAL <T, S> (x:T of <root>.test5, fn:kotlin.Function1<S of <root>.test5, kotlin.Unit>) returnType:kotlin.Unit
TYPE_PARAMETER name:T index:0 variance: superTypes:[S of <root>.test5?]
TYPE_PARAMETER name:S index:1 variance: superTypes:[kotlin.Any?]
VALUE_PARAMETER name:x index:0 type:T of <root>.test5
VALUE_PARAMETER name:fn index:1 type:kotlin.Function1<S of <root>.test5, kotlin.Unit>
BLOCK_BODY
WHEN type=kotlin.Unit origin=IF
BRANCH
if: CALL 'public final fun not (): kotlin.Boolean [operator] 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 'x: T of <root>.test5 declared in <root>.test5' type=T of <root>.test5 origin=null
arg1: CONST Null type=kotlin.Nothing? value=null
then: CALL 'public abstract fun invoke (p1: P1 of kotlin.Function1): R of kotlin.Function1 [operator] declared in kotlin.Function1' type=kotlin.Unit origin=INVOKE
$this: GET_VAR 'fn: kotlin.Function1<S of <root>.test5, kotlin.Unit> declared in <root>.test5' type=kotlin.Function1<S of <root>.test5, kotlin.Unit> origin=VARIABLE_AS_FUNCTION
p1: GET_VAR 'x: T of <root>.test5 declared in <root>.test5' type=T of <root>.test5 origin=null
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
fun test1(x: String?) =
if (x == null) 0 else x.length
+2 -2
View File
@@ -15,14 +15,14 @@ fun test(x: X, nx: X?) {
val tmp0_safe_receiver: X? = nx
when {
EQEQ(arg0 = tmp0_safe_receiver, arg1 = null) -> null
else -> tmp0_safe_receiver /*as X */.<get-xs>()
else -> tmp0_safe_receiver.<get-xs>()
}
}).plusAssign<Int>(element = 5)
CHECK_NOT_NULL<MutableList<Any>>(arg0 = { // BLOCK
val tmp1_safe_receiver: X? = nx
when {
EQEQ(arg0 = tmp1_safe_receiver, arg1 = null) -> null
else -> tmp1_safe_receiver /*as X */.f()
else -> tmp1_safe_receiver.f()
}
}).plusAssign<Int>(element = 6)
}
+2 -4
View File
@@ -62,8 +62,7 @@ FILE fqName:<root> fileName:/kt30020.kt
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CALL 'public abstract fun <get-xs> (): kotlin.collections.MutableList<kotlin.Any> declared in <root>.X' type=kotlin.collections.MutableList<kotlin.Any> origin=GET_PROPERTY
$this: TYPE_OP type=<root>.X origin=IMPLICIT_CAST typeOperand=<root>.X
GET_VAR 'val tmp_0: <root>.X? [val] declared in <root>.test' type=<root>.X? origin=null
$this: GET_VAR 'val tmp_0: <root>.X? [val] declared in <root>.test' type=<root>.X? origin=null
element: CONST Int type=kotlin.Int value=5
CALL 'public final fun plusAssign <T> (element: T of kotlin.collections.CollectionsKt.plusAssign): kotlin.Unit [inline,operator] declared in kotlin.collections.CollectionsKt' type=kotlin.Unit origin=null
<T>: kotlin.Int
@@ -81,8 +80,7 @@ FILE fqName:<root> fileName:/kt30020.kt
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CALL 'public abstract fun f (): kotlin.collections.MutableList<kotlin.Any> declared in <root>.X' type=kotlin.collections.MutableList<kotlin.Any> origin=null
$this: TYPE_OP type=<root>.X origin=IMPLICIT_CAST typeOperand=<root>.X
GET_VAR 'val tmp_1: <root>.X? [val] declared in <root>.test' type=<root>.X? origin=null
$this: GET_VAR 'val tmp_1: <root>.X? [val] declared in <root>.test' type=<root>.X? origin=null
element: CONST Int type=kotlin.Int value=6
FUN name:testExtensionReceiver visibility:public modality:FINAL <> ($receiver:kotlin.collections.MutableList<kotlin.Any>) returnType:kotlin.Unit
$receiver: VALUE_PARAMETER name:<this> type:kotlin.collections.MutableList<kotlin.Any>
@@ -17,7 +17,7 @@ fun test(nc: C?) {
val tmp0_safe_receiver: C? = nc
when {
EQEQ(arg0 = tmp0_safe_receiver, arg1 = null) -> null
else -> tmp0_safe_receiver /*as C */.<set-x>(<set-?> = 42)
else -> tmp0_safe_receiver.<set-x>(<set-?> = 42)
}
} /*~> Unit */
}
@@ -54,6 +54,5 @@ FILE fqName:<root> fileName:/safeAssignment.kt
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CALL 'public final fun <set-x> (<set-?>: kotlin.Int): kotlin.Unit declared in <root>.C' type=kotlin.Unit origin=EQ
$this: TYPE_OP type=<root>.C origin=IMPLICIT_CAST typeOperand=<root>.C
GET_VAR 'val tmp_0: <root>.C? [val] declared in <root>.test' type=<root>.C? origin=null
$this: GET_VAR 'val tmp_0: <root>.C? [val] declared in <root>.test' type=<root>.C? origin=null
<set-?>: CONST Int type=kotlin.Int value=42
@@ -21,7 +21,7 @@ operator fun Int?.inc(): Int? {
val tmp0_safe_receiver: Int? = <this>
when {
EQEQ(arg0 = tmp0_safe_receiver, arg1 = null) -> null
else -> tmp0_safe_receiver /*as Int */.inc()
else -> tmp0_safe_receiver.inc()
}
}
}
@@ -38,14 +38,14 @@ fun testProperty(nc: C?) {
val tmp1_safe_receiver: C? = nc
when {
EQEQ(arg0 = tmp1_safe_receiver, arg1 = null) -> null
else -> tmp1_safe_receiver /*as C */.<get-p>()
else -> tmp1_safe_receiver.<get-p>()
}
}
{ // BLOCK
val tmp2_safe_receiver: C? = nc
when {
EQEQ(arg0 = tmp2_safe_receiver, arg1 = null) -> null
else -> tmp2_safe_receiver /*as C */.<set-p>(value = <unary>.inc())
else -> tmp2_safe_receiver.<set-p>(value = <unary>.inc())
}
} /*~> Unit */
<unary> /*~> Unit */
@@ -56,7 +56,7 @@ fun testArrayAccess(nc: C?) {
val tmp3_safe_receiver: C? = nc
when {
EQEQ(arg0 = tmp3_safe_receiver, arg1 = null) -> null
else -> tmp3_safe_receiver /*as C */.<get-p>()
else -> tmp3_safe_receiver.<get-p>()
}
}
val <index0>: Int = 0
@@ -46,8 +46,7 @@ FILE fqName:test fileName:/safeCallWithIncrementDecrement.kt
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
$this: TYPE_OP type=kotlin.Int origin=IMPLICIT_CAST typeOperand=kotlin.Int
GET_VAR 'val tmp_0: kotlin.Int? [val] declared in test.inc' type=kotlin.Int? origin=null
$this: GET_VAR 'val tmp_0: kotlin.Int? [val] declared in test.inc' type=kotlin.Int? origin=null
FUN name:get visibility:public modality:FINAL <> ($receiver:kotlin.Int?, index:kotlin.Int) returnType:kotlin.Int [operator]
$receiver: VALUE_PARAMETER name:<this> type:kotlin.Int?
VALUE_PARAMETER name:index index:0 type:kotlin.Int
@@ -75,8 +74,7 @@ FILE fqName:test fileName:/safeCallWithIncrementDecrement.kt
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CALL 'public final fun <get-p> (): kotlin.Int declared in test' type=kotlin.Int origin=GET_PROPERTY
$receiver: TYPE_OP type=test.C origin=IMPLICIT_CAST typeOperand=test.C
GET_VAR 'val tmp_2: test.C? [val] declared in test.testProperty' type=test.C? origin=null
$receiver: GET_VAR 'val tmp_2: test.C? [val] declared in test.testProperty' type=test.C? origin=null
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
BLOCK type=kotlin.Unit? origin=SAFE_CALL
VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:test.C? [val]
@@ -90,8 +88,7 @@ FILE fqName:test fileName:/safeCallWithIncrementDecrement.kt
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CALL 'public final fun <set-p> (value: kotlin.Int): kotlin.Unit declared in test' type=kotlin.Unit origin=EQ
$receiver: TYPE_OP type=test.C origin=IMPLICIT_CAST typeOperand=test.C
GET_VAR 'val tmp_3: test.C? [val] declared in test.testProperty' type=test.C? origin=null
$receiver: GET_VAR 'val tmp_3: test.C? [val] declared in test.testProperty' type=test.C? origin=null
value: CALL 'public final fun inc (): kotlin.Int? [operator] declared in test' type=kotlin.Int? origin=null
$receiver: GET_VAR 'val tmp_1: kotlin.Int? [val] declared in test.testProperty' type=kotlin.Int? origin=null
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
@@ -112,8 +109,7 @@ FILE fqName:test fileName:/safeCallWithIncrementDecrement.kt
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CALL 'public final fun <get-p> (): kotlin.Int declared in test' type=kotlin.Int origin=GET_PROPERTY
$receiver: TYPE_OP type=test.C origin=IMPLICIT_CAST typeOperand=test.C
GET_VAR 'val tmp_5: test.C? [val] declared in test.testArrayAccess' type=test.C? origin=null
$receiver: GET_VAR 'val tmp_5: test.C? [val] declared in test.testArrayAccess' type=test.C? origin=null
VAR IR_TEMPORARY_VARIABLE name:tmp_6 type:kotlin.Int [val]
CONST Int type=kotlin.Int value=0
VAR IR_TEMPORARY_VARIABLE name:tmp_7 type:kotlin.Int [val]
@@ -24,7 +24,7 @@ fun test1(x: String?): Int? {
val tmp0_safe_receiver: String? = x
when {
EQEQ(arg0 = tmp0_safe_receiver, arg1 = null) -> null
else -> tmp0_safe_receiver /*as String */.<get-length>()
else -> tmp0_safe_receiver.<get-length>()
}
}
}
@@ -34,7 +34,7 @@ fun test2(x: String?): Int? {
val tmp1_safe_receiver: String? = x
when {
EQEQ(arg0 = tmp1_safe_receiver, arg1 = null) -> null
else -> tmp1_safe_receiver /*as String */.hashCode()
else -> tmp1_safe_receiver.hashCode()
}
}
}
@@ -44,7 +44,7 @@ fun test3(x: String?, y: Any?): Boolean? {
val tmp2_safe_receiver: String? = x
when {
EQEQ(arg0 = tmp2_safe_receiver, arg1 = null) -> null
else -> tmp2_safe_receiver /*as String */.equals(other = y)
else -> tmp2_safe_receiver.equals(other = y)
}
}
}
@@ -54,7 +54,7 @@ fun test4(x: Ref?) {
val tmp3_safe_receiver: Ref? = x
when {
EQEQ(arg0 = tmp3_safe_receiver, arg1 = null) -> null
else -> tmp3_safe_receiver /*as Ref */.<set-value>(<set-?> = 0)
else -> tmp3_safe_receiver.<set-value>(<set-?> = 0)
}
} /*~> Unit */
}
@@ -64,7 +64,7 @@ fun IHost.test5(s: String?): Int? {
val tmp4_safe_receiver: String? = s
when {
EQEQ(arg0 = tmp4_safe_receiver, arg1 = null) -> null
else -> (<this>, tmp4_safe_receiver /*as String */).extLength()
else -> (<this>, tmp4_safe_receiver).extLength()
}
}
}
+5 -10
View File
@@ -76,8 +76,7 @@ FILE fqName:<root> fileName:/safeCalls.kt
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CALL 'public open fun <get-length> (): kotlin.Int declared in kotlin.String' type=kotlin.Int origin=GET_PROPERTY
$this: TYPE_OP type=kotlin.String origin=IMPLICIT_CAST typeOperand=kotlin.String
GET_VAR 'val tmp_0: kotlin.String? [val] declared in <root>.test1' type=kotlin.String? origin=null
$this: GET_VAR 'val tmp_0: kotlin.String? [val] declared in <root>.test1' type=kotlin.String? origin=null
FUN name:test2 visibility:public modality:FINAL <> (x:kotlin.String?) returnType:kotlin.Int?
VALUE_PARAMETER name:x index:0 type:kotlin.String?
BLOCK_BODY
@@ -94,8 +93,7 @@ FILE fqName:<root> fileName:/safeCalls.kt
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CALL 'public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.String' type=kotlin.Int origin=null
$this: TYPE_OP type=kotlin.String origin=IMPLICIT_CAST typeOperand=kotlin.String
GET_VAR 'val tmp_1: kotlin.String? [val] declared in <root>.test2' type=kotlin.String? origin=null
$this: GET_VAR 'val tmp_1: kotlin.String? [val] declared in <root>.test2' type=kotlin.String? origin=null
FUN name:test3 visibility:public modality:FINAL <> (x:kotlin.String?, y:kotlin.Any?) returnType:kotlin.Boolean?
VALUE_PARAMETER name:x index:0 type:kotlin.String?
VALUE_PARAMETER name:y index:1 type:kotlin.Any?
@@ -113,8 +111,7 @@ FILE fqName:<root> fileName:/safeCalls.kt
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean [fake_override,operator] declared in kotlin.String' type=kotlin.Boolean origin=null
$this: TYPE_OP type=kotlin.String origin=IMPLICIT_CAST typeOperand=kotlin.String
GET_VAR 'val tmp_2: kotlin.String? [val] declared in <root>.test3' type=kotlin.String? origin=null
$this: GET_VAR 'val tmp_2: kotlin.String? [val] declared in <root>.test3' type=kotlin.String? origin=null
other: GET_VAR 'y: kotlin.Any? declared in <root>.test3' type=kotlin.Any? origin=null
FUN name:test4 visibility:public modality:FINAL <> (x:<root>.Ref?) returnType:kotlin.Unit
VALUE_PARAMETER name:x index:0 type:<root>.Ref?
@@ -132,8 +129,7 @@ FILE fqName:<root> fileName:/safeCalls.kt
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CALL 'public final fun <set-value> (<set-?>: kotlin.Int): kotlin.Unit declared in <root>.Ref' type=kotlin.Unit origin=EQ
$this: TYPE_OP type=<root>.Ref origin=IMPLICIT_CAST typeOperand=<root>.Ref
GET_VAR 'val tmp_3: <root>.Ref? [val] declared in <root>.test4' type=<root>.Ref? origin=null
$this: GET_VAR 'val tmp_3: <root>.Ref? [val] declared in <root>.test4' type=<root>.Ref? origin=null
<set-?>: CONST Int type=kotlin.Int value=0
FUN name:test5 visibility:public modality:FINAL <> ($receiver:<root>.IHost, s:kotlin.String?) returnType:kotlin.Int?
$receiver: VALUE_PARAMETER name:<this> type:<root>.IHost
@@ -153,8 +149,7 @@ FILE fqName:<root> fileName:/safeCalls.kt
if: CONST Boolean type=kotlin.Boolean value=true
then: CALL 'public open fun extLength (): kotlin.Int declared in <root>.IHost' type=kotlin.Int origin=null
$this: GET_VAR '<this>: <root>.IHost declared in <root>.test5' type=<root>.IHost origin=null
$receiver: TYPE_OP type=kotlin.String origin=IMPLICIT_CAST typeOperand=kotlin.String
GET_VAR 'val tmp_4: kotlin.String? [val] declared in <root>.test5' type=kotlin.String? origin=null
$receiver: GET_VAR 'val tmp_4: kotlin.String? [val] declared in <root>.test5' type=kotlin.String? origin=null
FUN name:foo visibility:public modality:FINAL <> ($receiver:kotlin.Int) returnType:kotlin.Int
$receiver: VALUE_PARAMETER name:<this> type:kotlin.Int
BLOCK_BODY
@@ -17,7 +17,7 @@ open enum class En : Enum<En> {
val tmp0_safe_receiver: Any? = <get-n>()
when {
EQEQ(arg0 = tmp0_safe_receiver, arg1 = null) -> null
else -> tmp0_safe_receiver /*as Any */.toString()
else -> tmp0_safe_receiver.toString()
}
})
@@ -42,8 +42,7 @@ FILE fqName:<root> fileName:/temporaryInEnumEntryInitializer.kt
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CALL 'public open fun toString (): kotlin.String declared in kotlin.Any' type=kotlin.String origin=null
$this: TYPE_OP type=kotlin.Any origin=IMPLICIT_CAST typeOperand=kotlin.Any
GET_VAR 'val tmp_0: kotlin.Any? [val] declared in <root>.En' type=kotlin.Any? origin=null
$this: GET_VAR 'val tmp_0: kotlin.Any? [val] declared in <root>.En' type=kotlin.Any? origin=null
FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<<root>.En>
SYNTHETIC_BODY kind=ENUM_VALUES
FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:<root>.En
@@ -13,7 +13,7 @@ class C {
val tmp0_safe_receiver: Any? = x
when {
EQEQ(arg0 = tmp0_safe_receiver, arg1 = null) -> null
else -> tmp0_safe_receiver /*as Any */.toString()
else -> tmp0_safe_receiver.toString()
}
}
}
@@ -31,8 +31,7 @@ FILE fqName:<root> fileName:/temporaryInInitBlock.kt
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CALL 'public open fun toString (): kotlin.String declared in kotlin.Any' type=kotlin.String origin=null
$this: TYPE_OP type=kotlin.Any origin=IMPLICIT_CAST typeOperand=kotlin.Any
GET_VAR 'val tmp_0: kotlin.Any? [val] declared in <root>.C' type=kotlin.Any? origin=null
$this: GET_VAR 'val tmp_0: kotlin.Any? [val] declared in <root>.C' type=kotlin.Any? 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
@@ -23,12 +23,12 @@ fun test4(ns: String?): String? {
val tmp0_safe_receiver: String? = ns
when {
EQEQ(arg0 = tmp0_safe_receiver, arg1 = null) -> null
else -> tmp0_safe_receiver /*as String */.k()
else -> tmp0_safe_receiver.k()
}
}
when {
EQEQ(arg0 = tmp1_safe_receiver, arg1 = null) -> null
else -> tmp1_safe_receiver /*as Function0<String> */.invoke()
else -> tmp1_safe_receiver.invoke()
}
}
}
@@ -45,8 +45,7 @@ FILE fqName:<root> fileName:/variableAsFunctionCall.kt
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CALL 'public final fun k (): kotlin.Function0<kotlin.String> declared in <root>' type=kotlin.Function0<kotlin.String> origin=null
$receiver: TYPE_OP type=kotlin.String origin=IMPLICIT_CAST typeOperand=kotlin.String
GET_VAR 'val tmp_1: kotlin.String? [val] declared in <root>.test4' type=kotlin.String? origin=null
$receiver: GET_VAR 'val tmp_1: kotlin.String? [val] declared in <root>.test4' type=kotlin.String? origin=null
WHEN type=kotlin.String? origin=null
BRANCH
if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ
@@ -56,5 +55,4 @@ FILE fqName:<root> fileName:/variableAsFunctionCall.kt
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CALL 'public abstract fun invoke (): R of kotlin.Function0 [operator] declared in kotlin.Function0' type=kotlin.String origin=INVOKE
$this: TYPE_OP type=kotlin.Function0<kotlin.String> origin=IMPLICIT_CAST typeOperand=kotlin.Function0<kotlin.String>
GET_VAR 'val tmp_0: kotlin.Function0<kotlin.String>? [val] declared in <root>.test4' type=kotlin.Function0<kotlin.String>? origin=null
$this: GET_VAR 'val tmp_0: kotlin.Function0<kotlin.String>? [val] declared in <root>.test4' type=kotlin.Function0<kotlin.String>? origin=null
+3 -3
View File
@@ -24,9 +24,9 @@ fun testWithSubject(x: Any?): String {
fun test(x: Any?): String {
return when {
EQEQ(arg0 = x, arg1 = null) -> "null"
EQEQ(arg0 = x /*as Any */, arg1 = A) -> "A"
x /*as Any */ is String -> "String"
x /*as Any */ !is Number -> "!Number"
EQEQ(arg0 = x, arg1 = A) -> "A"
x is String -> "String"
x !is Number -> "!Number"
setOf<Nothing>().contains<Number>(element = x /*as Number */) -> "nothingness?"
else -> "something"
}
+3 -6
View File
@@ -66,19 +66,16 @@ FILE fqName:<root> fileName:/when.kt
then: CONST String type=kotlin.String value="null"
BRANCH
if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ
arg0: TYPE_OP type=kotlin.Any origin=IMPLICIT_CAST typeOperand=kotlin.Any
GET_VAR 'x: kotlin.Any? declared in <root>.test' type=kotlin.Any? origin=null
arg0: GET_VAR 'x: kotlin.Any? declared in <root>.test' type=kotlin.Any? origin=null
arg1: GET_OBJECT 'CLASS OBJECT name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' type=<root>.A
then: CONST String type=kotlin.String value="A"
BRANCH
if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.String
TYPE_OP type=kotlin.Any origin=IMPLICIT_CAST typeOperand=kotlin.Any
GET_VAR 'x: kotlin.Any? declared in <root>.test' type=kotlin.Any? origin=null
GET_VAR 'x: kotlin.Any? declared in <root>.test' type=kotlin.Any? origin=null
then: CONST String type=kotlin.String value="String"
BRANCH
if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=kotlin.Number
TYPE_OP type=kotlin.Any origin=IMPLICIT_CAST typeOperand=kotlin.Any
GET_VAR 'x: kotlin.Any? declared in <root>.test' type=kotlin.Any? origin=null
GET_VAR 'x: kotlin.Any? declared in <root>.test' type=kotlin.Any? origin=null
then: CONST String type=kotlin.String value="!Number"
BRANCH
if: CALL 'public final fun contains <T> (element: T of kotlin.collections.CollectionsKt.contains): kotlin.Boolean [operator] declared in kotlin.collections.CollectionsKt' type=kotlin.Boolean origin=null
@@ -53,7 +53,7 @@ fun resolveClashesIfAny(container: ComponentContainer, clashResolvers: List<Plat
val <elvis>: Collection<ComponentDescriptor>? = <get-registrationMap>().get(p0 = resolver.<get-applicableTo>()) as? Collection<ComponentDescriptor>
when {
EQEQ(arg0 = <elvis>, arg1 = null) -> continue
else -> <elvis> /*as Collection<ComponentDescriptor> */
else -> <elvis>
}
}
val substituteDescriptor: ClashResolutionDescriptor<out PlatformSpecificExtension<out PlatformSpecificExtension<out PlatformSpecificExtension<out PlatformSpecificExtension<out PlatformSpecificExtension<out Any?>>>>>> = ClashResolutionDescriptor<PlatformSpecificExtension<out PlatformSpecificExtension<out PlatformSpecificExtension<out PlatformSpecificExtension<out PlatformSpecificExtension<out Any?>>>>>>(container = container, resolver = resolver, clashedComponents = clashedComponents.toList<ComponentDescriptor>())
@@ -164,8 +164,7 @@ FILE fqName:<root> fileName:/ClashResolutionDescriptor.kt
then: CONTINUE label=null loop.label=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: TYPE_OP type=kotlin.collections.Collection<<root>.ComponentDescriptor> origin=IMPLICIT_CAST typeOperand=kotlin.collections.Collection<<root>.ComponentDescriptor>
GET_VAR 'val tmp_1: kotlin.collections.Collection<<root>.ComponentDescriptor>? [val] declared in <root>.resolveClashesIfAny' type=kotlin.collections.Collection<<root>.ComponentDescriptor>? origin=null
then: GET_VAR 'val tmp_1: kotlin.collections.Collection<<root>.ComponentDescriptor>? [val] declared in <root>.resolveClashesIfAny' type=kotlin.collections.Collection<<root>.ComponentDescriptor>? origin=null
VAR name:substituteDescriptor type:<root>.ClashResolutionDescriptor<out <root>.PlatformSpecificExtension<out <root>.PlatformSpecificExtension<out <root>.PlatformSpecificExtension<out <root>.PlatformSpecificExtension<out <root>.PlatformSpecificExtension<out kotlin.Any?>>>>>> [val]
CONSTRUCTOR_CALL 'public constructor <init> (container: <root>.ComponentContainer, resolver: <root>.PlatformExtensionsClashResolver<E of <root>.ClashResolutionDescriptor>, clashedComponents: kotlin.collections.List<<root>.ComponentDescriptor>) [primary] declared in <root>.ClashResolutionDescriptor' type=<root>.ClashResolutionDescriptor<out <root>.PlatformSpecificExtension<out <root>.PlatformSpecificExtension<out <root>.PlatformSpecificExtension<out <root>.PlatformSpecificExtension<out <root>.PlatformSpecificExtension<out kotlin.Any?>>>>>> origin=null
<class: E>: <root>.PlatformSpecificExtension<out <root>.PlatformSpecificExtension<out <root>.PlatformSpecificExtension<out <root>.PlatformSpecificExtension<out <root>.PlatformSpecificExtension<out kotlin.Any?>>>>>
@@ -79,7 +79,7 @@ fun box(): String {
val tmp0_safe_receiver: ImplicitReceiverValue<*>? = stack.get(name = null)
when {
EQEQ(arg0 = tmp0_safe_receiver, arg1 = null) -> null
else -> tmp0_safe_receiver /*as ImplicitReceiverValue<*> */.<get-type>()
else -> tmp0_safe_receiver.<get-type>()
}
})
}
@@ -249,5 +249,4 @@ FILE fqName:<root> fileName:/ImplicitReceiverStack.kt
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CALL 'public final fun <get-type> (): kotlin.String declared in <root>.ImplicitReceiverValue' type=kotlin.String origin=GET_PROPERTY
$this: TYPE_OP type=<root>.ImplicitReceiverValue<*> origin=IMPLICIT_CAST typeOperand=<root>.ImplicitReceiverValue<*>
GET_VAR 'val tmp_0: <root>.ImplicitReceiverValue<*>? [val] declared in <root>.box' type=<root>.ImplicitReceiverValue<*>? origin=null
$this: GET_VAR 'val tmp_0: <root>.ImplicitReceiverValue<*>? [val] declared in <root>.box' type=<root>.ImplicitReceiverValue<*>? origin=null
@@ -10,7 +10,7 @@ private fun Reader.nextChar(): Char? {
)
when {
EQEQ(arg0 = tmp0_safe_receiver, arg1 = null) -> null
else -> tmp0_safe_receiver /*as Int */.toChar()
else -> tmp0_safe_receiver.toChar()
}
}
}
@@ -18,21 +18,21 @@ private fun Reader.nextChar(): Char? {
fun Reader.consumeRestOfQuotedSequence(sb: StringBuilder, quote: Char) {
var ch: Char? = <this>.nextChar()
while (when {
EQEQ(arg0 = ch, arg1 = null).not() -> EQEQ(arg0 = ch /*as Char */, arg1 = quote).not()
EQEQ(arg0 = ch, arg1 = null).not() -> EQEQ(arg0 = ch, arg1 = quote).not()
else -> false
}) { // BLOCK
when {
EQEQ(arg0 = ch /*as Char */, arg1 = <get-BACKSLASH>()) -> { // BLOCK
EQEQ(arg0 = ch, arg1 = <get-BACKSLASH>()) -> { // BLOCK
val tmp1_safe_receiver: Char? = <this>.nextChar()
when {
EQEQ(arg0 = tmp1_safe_receiver, arg1 = null) -> null
else -> tmp1_safe_receiver /*as Char */.let<Char, StringBuilder?>(block = local fun <anonymous>(it: Char): StringBuilder? {
else -> tmp1_safe_receiver.let<Char, StringBuilder?>(block = local fun <anonymous>(it: Char): StringBuilder? {
return sb.append(p0 = it)
}
)
}
}
else -> sb.append(p0 = ch /*as Char */)
else -> sb.append(p0 = ch)
} /*~> Unit */
ch = <this>.nextChar()
}
@@ -35,8 +35,7 @@ FILE fqName:<root> fileName:/coercionToUnitForNestedWhen.kt
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CALL 'public open fun toChar (): kotlin.Char declared in kotlin.Int' type=kotlin.Char origin=null
$this: TYPE_OP type=kotlin.Int origin=IMPLICIT_CAST typeOperand=kotlin.Int
GET_VAR 'val tmp_0: kotlin.Int? [val] declared in <root>.nextChar' type=kotlin.Int? origin=null
$this: GET_VAR 'val tmp_0: kotlin.Int? [val] declared in <root>.nextChar' type=kotlin.Int? origin=null
FUN name:consumeRestOfQuotedSequence visibility:public modality:FINAL <> ($receiver:java.io.Reader, sb:java.lang.StringBuilder, quote:kotlin.Char) returnType:kotlin.Unit
$receiver: VALUE_PARAMETER name:<this> type:java.io.Reader
VALUE_PARAMETER name:sb index:0 type:java.lang.StringBuilder
@@ -54,8 +53,7 @@ FILE fqName:<root> fileName:/coercionToUnitForNestedWhen.kt
arg1: CONST Null type=kotlin.Nothing? value=null
then: CALL 'public final fun not (): kotlin.Boolean [operator] 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: TYPE_OP type=kotlin.Char origin=IMPLICIT_CAST typeOperand=kotlin.Char
GET_VAR 'var ch: kotlin.Char? [var] declared in <root>.consumeRestOfQuotedSequence' type=kotlin.Char? origin=null
arg0: GET_VAR 'var ch: kotlin.Char? [var] declared in <root>.consumeRestOfQuotedSequence' type=kotlin.Char? origin=null
arg1: GET_VAR 'quote: kotlin.Char declared in <root>.consumeRestOfQuotedSequence' type=kotlin.Char origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
@@ -65,8 +63,7 @@ FILE fqName:<root> fileName:/coercionToUnitForNestedWhen.kt
WHEN type=@[FlexibleNullability] java.lang.StringBuilder? origin=IF
BRANCH
if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ
arg0: TYPE_OP type=kotlin.Char origin=IMPLICIT_CAST typeOperand=kotlin.Char
GET_VAR 'var ch: kotlin.Char? [var] declared in <root>.consumeRestOfQuotedSequence' type=kotlin.Char? origin=null
arg0: GET_VAR 'var ch: kotlin.Char? [var] declared in <root>.consumeRestOfQuotedSequence' type=kotlin.Char? origin=null
arg1: CALL 'private final fun <get-BACKSLASH> (): kotlin.Char declared in <root>' type=kotlin.Char origin=GET_PROPERTY
then: BLOCK type=java.lang.StringBuilder? origin=SAFE_CALL
VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.Char? [val]
@@ -83,8 +80,7 @@ FILE fqName:<root> fileName:/coercionToUnitForNestedWhen.kt
then: CALL 'public final fun let <T, R> (block: kotlin.Function1<T of kotlin.StandardKt.let, R of kotlin.StandardKt.let>): R of kotlin.StandardKt.let [inline] declared in kotlin.StandardKt' type=java.lang.StringBuilder? origin=null
<T>: kotlin.Char
<R>: java.lang.StringBuilder?
$receiver: TYPE_OP type=kotlin.Char origin=IMPLICIT_CAST typeOperand=kotlin.Char
GET_VAR 'val tmp_1: kotlin.Char? [val] declared in <root>.consumeRestOfQuotedSequence' type=kotlin.Char? origin=null
$receiver: GET_VAR 'val tmp_1: kotlin.Char? [val] declared in <root>.consumeRestOfQuotedSequence' type=kotlin.Char? origin=null
block: FUN_EXPR type=kotlin.Function1<kotlin.Char, java.lang.StringBuilder?> origin=LAMBDA
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> (it:kotlin.Char) returnType:java.lang.StringBuilder?
VALUE_PARAMETER name:it index:0 type:kotlin.Char
@@ -97,8 +93,7 @@ FILE fqName:<root> fileName:/coercionToUnitForNestedWhen.kt
if: CONST Boolean type=kotlin.Boolean value=true
then: CALL 'public open fun append (p0: kotlin.Char): java.lang.StringBuilder? declared in java.lang.StringBuilder' type=java.lang.StringBuilder? origin=null
$this: GET_VAR 'sb: java.lang.StringBuilder declared in <root>.consumeRestOfQuotedSequence' type=java.lang.StringBuilder origin=null
p0: TYPE_OP type=kotlin.Char origin=IMPLICIT_CAST typeOperand=kotlin.Char
GET_VAR 'var ch: kotlin.Char? [var] declared in <root>.consumeRestOfQuotedSequence' type=kotlin.Char? origin=null
p0: GET_VAR 'var ch: kotlin.Char? [var] declared in <root>.consumeRestOfQuotedSequence' type=kotlin.Char? origin=null
SET_VAR 'var ch: kotlin.Char? [var] declared in <root>.consumeRestOfQuotedSequence' type=kotlin.Unit origin=EQ
CALL 'private final fun nextChar (): kotlin.Char? declared in <root>' type=kotlin.Char? origin=null
$receiver: GET_VAR '<this>: java.io.Reader declared in <root>.consumeRestOfQuotedSequence' type=java.io.Reader origin=null
@@ -23,10 +23,10 @@ class Flaf {
result = Flaf(javaName = javaName)
}
}
<this>.<get-INSTANCES>().set<String, Flaf>(key = javaName, value = result /*as Flaf */)
<this>.<get-INSTANCES>().set<String, Flaf>(key = javaName, value = result)
}
}
return result /*as Flaf */
return result
}
}
@@ -68,11 +68,9 @@ FILE fqName:<root> fileName:/inapplicableCollectionSet.kt
$receiver: CALL 'private final fun <get-INSTANCES> (): kotlin.collections.MutableMap<kotlin.String, <root>.Flaf> declared in <root>.Flaf' type=kotlin.collections.MutableMap<kotlin.String, <root>.Flaf> origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.Flaf declared in <root>.Flaf.forJavaName' type=<root>.Flaf origin=null
key: GET_VAR 'javaName: kotlin.String declared in <root>.Flaf.forJavaName' type=kotlin.String origin=null
value: TYPE_OP type=<root>.Flaf origin=IMPLICIT_CAST typeOperand=<root>.Flaf
GET_VAR 'var result: <root>.Flaf? [var] declared in <root>.Flaf.forJavaName' type=<root>.Flaf? origin=null
value: GET_VAR 'var result: <root>.Flaf? [var] declared in <root>.Flaf.forJavaName' type=<root>.Flaf? origin=null
RETURN type=kotlin.Nothing from='public final fun forJavaName (javaName: kotlin.String): <root>.Flaf declared in <root>.Flaf'
TYPE_OP type=<root>.Flaf origin=IMPLICIT_CAST typeOperand=<root>.Flaf
GET_VAR 'var result: <root>.Flaf? [var] declared in <root>.Flaf.forJavaName' type=<root>.Flaf? origin=null
GET_VAR 'var result: <root>.Flaf? [var] declared in <root>.Flaf.forJavaName' type=<root>.Flaf? 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
@@ -59,8 +59,8 @@ class IdeWizard {
when {
EQEQ(arg0 = value, arg1 = null) -> return Unit
}
reference.<set-t>(<set-?> = SettingType<V>(type = value /*as V */::class) as T)
reference.<set-v>(<set-?> = value /*as V */)
reference.<set-t>(<set-?> = SettingType<V>(type = value::class) as T)
reference.<set-v>(<set-?> = value)
}
override operator fun getValue(thisRef: Any?, property: KProperty<*>): V? {
@@ -169,12 +169,10 @@ FILE fqName:<root> fileName:/readWriteProperty.kt
CONSTRUCTOR_CALL 'public constructor <init> (type: kotlin.reflect.KClass<out V of <root>.SettingType>) [primary] declared in <root>.SettingType' type=<root>.SettingType<V of <root>.IdeWizard.setting> origin=null
<class: V>: V of <root>.IdeWizard.setting
type: GET_CLASS type=kotlin.reflect.KClass<V of <root>.IdeWizard.setting>
TYPE_OP type=V of <root>.IdeWizard.setting origin=IMPLICIT_CAST typeOperand=V of <root>.IdeWizard.setting
GET_VAR 'value: V of <root>.IdeWizard.setting? declared in <root>.IdeWizard.setting.<no name provided>.setValue' type=V of <root>.IdeWizard.setting? origin=null
GET_VAR 'value: V of <root>.IdeWizard.setting? declared in <root>.IdeWizard.setting.<no name provided>.setValue' type=V of <root>.IdeWizard.setting? origin=null
CALL 'public final fun <set-v> (<set-?>: V of <root>.SettingReference): kotlin.Unit declared in <root>.SettingReference' type=kotlin.Unit origin=EQ
$this: GET_VAR 'reference: <root>.SettingReference<V of <root>.IdeWizard.setting, T of <root>.IdeWizard.setting> declared in <root>.IdeWizard.setting' type=<root>.SettingReference<V of <root>.IdeWizard.setting, T of <root>.IdeWizard.setting> origin=null
<set-?>: TYPE_OP type=V of <root>.IdeWizard.setting origin=IMPLICIT_CAST typeOperand=V of <root>.IdeWizard.setting
GET_VAR 'value: V of <root>.IdeWizard.setting? declared in <root>.IdeWizard.setting.<no name provided>.setValue' type=V of <root>.IdeWizard.setting? origin=null
<set-?>: GET_VAR 'value: V of <root>.IdeWizard.setting? declared in <root>.IdeWizard.setting.<no name provided>.setValue' type=V of <root>.IdeWizard.setting? origin=null
FUN name:getValue visibility:public modality:FINAL <> ($this:<root>.IdeWizard.setting.<no name provided><V of <root>.IdeWizard.setting, T of <root>.IdeWizard.setting>, thisRef:kotlin.Any?, property:kotlin.reflect.KProperty<*>) returnType:V of <root>.IdeWizard.setting? [operator]
overridden:
public abstract fun getValue (thisRef: T of kotlin.properties.ReadWriteProperty, property: kotlin.reflect.KProperty<*>): V of kotlin.properties.ReadWriteProperty [operator] declared in kotlin.properties.ReadWriteProperty
@@ -42,7 +42,7 @@ private fun CoroutineScope.asFairChannel(flow: Flow<*>): ReceiveChannel<Any> {
val <elvis>: Any? = value
when {
EQEQ(arg0 = <elvis>, arg1 = null) -> Any()
else -> <elvis> /*as Any */
else -> <elvis>
}
})
}
@@ -58,7 +58,7 @@ private fun CoroutineScope.asChannel(flow: Flow<*>): ReceiveChannel<Any> {
val <elvis>: Any? = value
when {
EQEQ(arg0 = <elvis>, arg1 = null) -> Any()
else -> <elvis> /*as Any */
else -> <elvis>
}
})
}
@@ -141,4 +141,3 @@ interface SendChannel<in E : Any?> {
abstract suspend fun send(e: E)
}
@@ -114,8 +114,7 @@ FILE fqName:<root> fileName:/castsInsideCoroutineInference.kt
then: CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any' type=kotlin.Any origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: TYPE_OP type=kotlin.Any origin=IMPLICIT_CAST typeOperand=kotlin.Any
GET_VAR 'val tmp_0: kotlin.Any? [val] declared in <root>.asFairChannel.<anonymous>.<anonymous>' type=kotlin.Any? origin=null
then: GET_VAR 'val tmp_0: kotlin.Any? [val] declared in <root>.asFairChannel.<anonymous>.<anonymous>' type=kotlin.Any? origin=null
FUN name:asChannel visibility:private modality:FINAL <> ($receiver:<root>.CoroutineScope, flow:<root>.Flow<*>) returnType:<root>.ReceiveChannel<kotlin.Any>
$receiver: VALUE_PARAMETER name:<this> type:<root>.CoroutineScope
VALUE_PARAMETER name:flow index:0 type:<root>.Flow<*>
@@ -150,8 +149,7 @@ FILE fqName:<root> fileName:/castsInsideCoroutineInference.kt
then: CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any' type=kotlin.Any origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: TYPE_OP type=kotlin.Any origin=IMPLICIT_CAST typeOperand=kotlin.Any
GET_VAR 'val tmp_1: kotlin.Any? [val] declared in <root>.asChannel.<anonymous>.<anonymous>' type=kotlin.Any? origin=null
then: GET_VAR 'val tmp_1: kotlin.Any? [val] declared in <root>.asChannel.<anonymous>.<anonymous>' type=kotlin.Any? origin=null
CLASS CLASS name:SafeCollector modality:FINAL visibility:public superTypes:[<root>.FlowCollector<T of <root>.SafeCollector>]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.SafeCollector<T of <root>.SafeCollector>
TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?]