diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrVisitor.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrVisitor.kt index 4a43d31f5ed..bd3557bf582 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrVisitor.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrVisitor.kt @@ -899,7 +899,18 @@ class Fir2IrVisitor( } override fun visitExpressionWithSmartcast(expressionWithSmartcast: FirExpressionWithSmartcast, data: Any?): IrElement { - return visitQualifiedAccessExpression(expressionWithSmartcast, data) + // Generate the expression with the original type and then cast it to the smart cast type. + val value = expressionWithSmartcast.toIrExpression(expressionWithSmartcast.originalType).applyReceivers(expressionWithSmartcast) + val castType = expressionWithSmartcast.typeRef.toIrType(session, declarationStorage) + if (value.type == castType) return value + return IrTypeOperatorCallImpl( + value.startOffset, + value.endOffset, + castType, + IrTypeOperator.IMPLICIT_CAST, + castType, + value + ) } override fun visitCallableReferenceAccess(callableReferenceAccess: FirCallableReferenceAccess, data: Any?): IrElement { diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/JvmOptimizationLowering.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/JvmOptimizationLowering.kt index d547596abb7..f8d7f4aa9ed 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/JvmOptimizationLowering.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/JvmOptimizationLowering.kt @@ -30,7 +30,7 @@ import org.jetbrains.kotlin.ir.visitors.IrElementTransformer internal val jvmOptimizationLoweringPhase = makeIrFilePhase( ::JvmOptimizationLowering, - name = "JvmBuiltinOptimizationLowering", + name = "JvmOptimizationLowering", description = "Optimize code for JVM code generation" ) diff --git a/compiler/testData/codegen/box/casts/functions/asFunKSmall.kt b/compiler/testData/codegen/box/casts/functions/asFunKSmall.kt index ba59dbf1e1d..d1bd64ff458 100644 --- a/compiler/testData/codegen/box/casts/functions/asFunKSmall.kt +++ b/compiler/testData/codegen/box/casts/functions/asFunKSmall.kt @@ -1,3 +1,7 @@ +// FIR inserts incorrect smart casts based on the cast in the +// lambda. However, that cast can fail and the failure can be caught +// by the inline function. +// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/ieee754/greaterDouble.kt b/compiler/testData/codegen/box/ieee754/greaterDouble.kt index f7df271d413..97550192672 100644 --- a/compiler/testData/codegen/box/ieee754/greaterDouble.kt +++ b/compiler/testData/codegen/box/ieee754/greaterDouble.kt @@ -1,5 +1,4 @@ // !LANGUAGE: -ProperIeee754Comparisons -// IGNORE_BACKEND_FIR: JVM_IR // DONT_TARGET_EXACT_BACKEND: JS_IR fun greater1(a: Double, b: Double) = a > b diff --git a/compiler/testData/codegen/box/ieee754/greaterFloat.kt b/compiler/testData/codegen/box/ieee754/greaterFloat.kt index 78c23de177e..b5b0844ad5e 100644 --- a/compiler/testData/codegen/box/ieee754/greaterFloat.kt +++ b/compiler/testData/codegen/box/ieee754/greaterFloat.kt @@ -1,5 +1,4 @@ // !LANGUAGE: -ProperIeee754Comparisons -// IGNORE_BACKEND_FIR: JVM_IR // DONT_TARGET_EXACT_BACKEND: JS_IR fun greater1(a: Float, b: Float) = a > b diff --git a/compiler/testData/codegen/box/ieee754/lessDouble.kt b/compiler/testData/codegen/box/ieee754/lessDouble.kt index b54e8141222..3a5d0734dcf 100644 --- a/compiler/testData/codegen/box/ieee754/lessDouble.kt +++ b/compiler/testData/codegen/box/ieee754/lessDouble.kt @@ -1,5 +1,4 @@ // !LANGUAGE: -ProperIeee754Comparisons -// IGNORE_BACKEND_FIR: JVM_IR // DONT_TARGET_EXACT_BACKEND: JS_IR fun less1(a: Double, b: Double) = a < b diff --git a/compiler/testData/codegen/box/ieee754/lessFloat.kt b/compiler/testData/codegen/box/ieee754/lessFloat.kt index eb5f1b3e537..b62dabdd52b 100644 --- a/compiler/testData/codegen/box/ieee754/lessFloat.kt +++ b/compiler/testData/codegen/box/ieee754/lessFloat.kt @@ -1,5 +1,4 @@ // !LANGUAGE: -ProperIeee754Comparisons -// IGNORE_BACKEND_FIR: JVM_IR // DONT_TARGET_EXACT_BACKEND: JS_IR fun less1(a: Float, b: Float) = a < b diff --git a/compiler/testData/codegen/box/ieee754/whenNoSubject.kt b/compiler/testData/codegen/box/ieee754/whenNoSubject.kt index 948ff5bb0ad..e0b371506f9 100644 --- a/compiler/testData/codegen/box/ieee754/whenNoSubject.kt +++ b/compiler/testData/codegen/box/ieee754/whenNoSubject.kt @@ -1,5 +1,4 @@ // !LANGUAGE: -ProperIeee754Comparisons -// IGNORE_BACKEND_FIR: JVM_IR // DONT_TARGET_EXACT_BACKEND: JS_IR fun box(): String { diff --git a/compiler/testData/ir/irText/declarations/localDelegatedProperties.fir.txt b/compiler/testData/ir/irText/declarations/localDelegatedProperties.fir.txt index 8ef3581d992..5d7aecd75e3 100644 --- a/compiler/testData/ir/irText/declarations/localDelegatedProperties.fir.txt +++ b/compiler/testData/ir/irText/declarations/localDelegatedProperties.fir.txt @@ -10,7 +10,8 @@ FILE fqName: fileName:/localDelegatedProperties.kt SET_VAR 'var x: IrErrorType [var] declared in .test2' type=IrErrorType origin=null CONST Int type=kotlin.Int value=0 VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.Int [val] - GET_VAR 'var x: IrErrorType [var] declared in .test2' type=kotlin.Int origin=null + TYPE_OP type=kotlin.Int origin=IMPLICIT_CAST typeOperand=kotlin.Int + GET_VAR 'var x: IrErrorType [var] declared in .test2' type=IrErrorType origin=null SET_VAR 'var x: IrErrorType [var] declared in .test2' type=IrErrorType origin=null 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 .test2' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/expressions/bangbang.fir.txt b/compiler/testData/ir/irText/expressions/bangbang.fir.txt index dcb24876968..cbd2623cc0a 100644 --- a/compiler/testData/ir/irText/expressions/bangbang.fir.txt +++ b/compiler/testData/ir/irText/expressions/bangbang.fir.txt @@ -35,7 +35,8 @@ FILE fqName: fileName:/bangbang.kt GET_VAR 'a: X of .test4 declared in .test4' type=X of .test4 origin=null then: CALL 'public final fun CHECK_NOT_NULL (arg0: T0 of kotlin.internal.ir.CHECK_NOT_NULL?): T0 of kotlin.internal.ir.CHECK_NOT_NULL declared in kotlin.internal.ir' type=kotlin.String? origin=EXCLEXCL : kotlin.String - arg0: GET_VAR 'a: X of .test4 declared in .test4' type=kotlin.String? origin=null + arg0: TYPE_OP type=kotlin.String? origin=IMPLICIT_CAST typeOperand=kotlin.String? + GET_VAR 'a: X of .test4 declared in .test4' type=X of .test4 origin=null WHEN type=kotlin.Unit origin=IF BRANCH if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.String? @@ -43,4 +44,5 @@ FILE fqName: fileName:/bangbang.kt then: CALL 'public final fun useString (s: kotlin.String): kotlin.Unit declared in ' type=kotlin.Unit origin=null s: CALL 'public final fun CHECK_NOT_NULL (arg0: T0 of kotlin.internal.ir.CHECK_NOT_NULL?): T0 of kotlin.internal.ir.CHECK_NOT_NULL declared in kotlin.internal.ir' type=kotlin.String? origin=EXCLEXCL : kotlin.String - arg0: GET_VAR 'a: X of .test4 declared in .test4' type=kotlin.String? origin=null + arg0: TYPE_OP type=kotlin.String? origin=IMPLICIT_CAST typeOperand=kotlin.String? + GET_VAR 'a: X of .test4 declared in .test4' type=X of .test4 origin=null diff --git a/compiler/testData/ir/irText/expressions/breakContinueInLoopHeader.fir.txt b/compiler/testData/ir/irText/expressions/breakContinueInLoopHeader.fir.txt index a2286fb938c..1ad8ea57dc8 100644 --- a/compiler/testData/ir/irText/expressions/breakContinueInLoopHeader.fir.txt +++ b/compiler/testData/ir/irText/expressions/breakContinueInLoopHeader.fir.txt @@ -17,7 +17,8 @@ FILE fqName: fileName:/breakContinueInLoopHeader.kt then: BREAK label=null loop.label=L BRANCH if: CONST Boolean type=kotlin.Boolean value=true - then: GET_VAR 'val tmp_0: kotlin.Boolean? [val] declared in .test1' type=kotlin.Boolean origin=null + then: TYPE_OP type=kotlin.Boolean origin=IMPLICIT_CAST typeOperand=kotlin.Boolean + GET_VAR 'val tmp_0: kotlin.Boolean? [val] declared in .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? @@ -37,7 +38,8 @@ FILE fqName: fileName:/breakContinueInLoopHeader.kt then: CONTINUE label=null loop.label=L BRANCH if: CONST Boolean type=kotlin.Boolean value=true - then: GET_VAR 'val tmp_1: kotlin.Boolean? [val] declared in .test2' type=kotlin.Boolean origin=null + then: TYPE_OP type=kotlin.Boolean origin=IMPLICIT_CAST typeOperand=kotlin.Boolean + GET_VAR 'val tmp_1: kotlin.Boolean? [val] declared in .test2' type=kotlin.Boolean? origin=null body: BLOCK type=kotlin.Unit origin=null FUN name:test3 visibility:public modality:FINAL <> (ss:kotlin.collections.List?) returnType:kotlin.Unit VALUE_PARAMETER name:ss index:0 type:kotlin.collections.List? @@ -57,7 +59,8 @@ FILE fqName: fileName:/breakContinueInLoopHeader.kt then: CONTINUE label=null loop.label=L BRANCH if: CONST Boolean type=kotlin.Boolean value=true - then: GET_VAR 'val tmp_3: kotlin.collections.List? [val] declared in .test3' type=kotlin.collections.List origin=null + then: TYPE_OP type=kotlin.collections.List origin=IMPLICIT_CAST typeOperand=kotlin.collections.List + GET_VAR 'val tmp_3: kotlin.collections.List? [val] declared in .test3' type=kotlin.collections.List? origin=null VAR IR_TEMPORARY_VARIABLE name:tmp_4 type:kotlin.collections.Iterator [val] CALL 'public abstract fun iterator (): kotlin.collections.Iterator [operator] declared in kotlin.collections.List' type=kotlin.collections.Iterator origin=null $this: GET_VAR 'val tmp_2: kotlin.collections.List [val] declared in .test3' type=kotlin.collections.List origin=null @@ -86,7 +89,8 @@ FILE fqName: fileName:/breakContinueInLoopHeader.kt then: BREAK label=null loop.label=L BRANCH if: CONST Boolean type=kotlin.Boolean value=true - then: GET_VAR 'val tmp_6: kotlin.collections.List? [val] declared in .test4' type=kotlin.collections.List origin=null + then: TYPE_OP type=kotlin.collections.List origin=IMPLICIT_CAST typeOperand=kotlin.collections.List + GET_VAR 'val tmp_6: kotlin.collections.List? [val] declared in .test4' type=kotlin.collections.List? origin=null VAR IR_TEMPORARY_VARIABLE name:tmp_7 type:kotlin.collections.Iterator [val] CALL 'public abstract fun iterator (): kotlin.collections.Iterator [operator] declared in kotlin.collections.List' type=kotlin.collections.Iterator origin=null $this: GET_VAR 'val tmp_5: kotlin.collections.List [val] declared in .test4' type=kotlin.collections.List origin=null diff --git a/compiler/testData/ir/irText/expressions/callableReferences/caoWithAdaptationForSam.fir.txt b/compiler/testData/ir/irText/expressions/callableReferences/caoWithAdaptationForSam.fir.txt index 2c806c27c61..fe8b7fb6302 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/caoWithAdaptationForSam.fir.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/caoWithAdaptationForSam.fir.txt @@ -133,5 +133,6 @@ FILE fqName: fileName:/caoWithAdaptationForSam.kt TYPE_OP type=kotlin.Function1 origin=CAST typeOperand=kotlin.Function1 GET_VAR 'a: kotlin.Any declared in .test6' type=kotlin.Any origin=null TYPE_OP type=.IFoo origin=CAST typeOperand=.IFoo - GET_VAR 'a: kotlin.Any declared in .test6' type=kotlin.Function1 origin=null + TYPE_OP type=kotlin.Function1 origin=IMPLICIT_CAST typeOperand=kotlin.Function1 + GET_VAR 'a: kotlin.Any declared in .test6' type=kotlin.Any origin=null ERROR_CALL 'FirArraySetCall (resolve isn't supported yet)' type=kotlin.Unit diff --git a/compiler/testData/ir/irText/expressions/elvis.fir.txt b/compiler/testData/ir/irText/expressions/elvis.fir.txt index 958ad31f503..60026ac1a63 100644 --- a/compiler/testData/ir/irText/expressions/elvis.fir.txt +++ b/compiler/testData/ir/irText/expressions/elvis.fir.txt @@ -28,7 +28,8 @@ FILE fqName: fileName:/elvis.kt then: GET_VAR 'b: kotlin.Any declared in .test1' type=kotlin.Any origin=null BRANCH if: CONST Boolean type=kotlin.Boolean value=true - then: GET_VAR 'val tmp_0: kotlin.Any? [val] declared in .test1' type=kotlin.Any origin=null + then: TYPE_OP type=kotlin.Any origin=IMPLICIT_CAST typeOperand=kotlin.Any + GET_VAR 'val tmp_0: kotlin.Any? [val] declared in .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 @@ -45,7 +46,8 @@ FILE fqName: fileName:/elvis.kt then: GET_VAR 'b: kotlin.Any declared in .test2' type=kotlin.Any origin=null BRANCH if: CONST Boolean type=kotlin.Boolean value=true - then: GET_VAR 'val tmp_1: kotlin.String? [val] declared in .test2' type=kotlin.String origin=null + then: TYPE_OP type=kotlin.String origin=IMPLICIT_CAST typeOperand=kotlin.String + GET_VAR 'val tmp_1: kotlin.String? [val] declared in .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? @@ -65,16 +67,19 @@ FILE fqName: fileName:/elvis.kt RETURN type=kotlin.Nothing from='public final fun test3 (a: kotlin.Any?, b: kotlin.Any?): kotlin.String declared in ' BLOCK type=kotlin.String origin=ELVIS VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:kotlin.String? [val] - GET_VAR 'a: kotlin.Any? declared in .test3' type=kotlin.String? origin=null + TYPE_OP type=kotlin.String? origin=IMPLICIT_CAST typeOperand=kotlin.String? + GET_VAR 'a: kotlin.Any? declared in .test3' type=kotlin.Any? origin=null WHEN type=kotlin.String origin=ELVIS BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ arg0: GET_VAR 'val tmp_2: kotlin.String? [val] declared in .test3' type=kotlin.String? origin=null arg1: CONST Null type=kotlin.Nothing? value=null - then: GET_VAR 'b: kotlin.Any? declared in .test3' type=kotlin.String origin=null + then: TYPE_OP type=kotlin.String origin=IMPLICIT_CAST typeOperand=kotlin.String + GET_VAR 'b: kotlin.Any? declared in .test3' type=kotlin.Any? origin=null BRANCH if: CONST Boolean type=kotlin.Boolean value=true - then: GET_VAR 'val tmp_2: kotlin.String? [val] declared in .test3' type=kotlin.String origin=null + then: TYPE_OP type=kotlin.String origin=IMPLICIT_CAST typeOperand=kotlin.String + GET_VAR 'val tmp_2: kotlin.String? [val] declared in .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 @@ -90,7 +95,8 @@ FILE fqName: fileName:/elvis.kt then: GET_VAR 'x: kotlin.Any declared in .test4' type=kotlin.Any origin=null BRANCH if: CONST Boolean type=kotlin.Boolean value=true - then: GET_VAR 'val tmp_3: kotlin.Any? [val] declared in .test4' type=kotlin.Any origin=null + then: TYPE_OP type=kotlin.Any origin=IMPLICIT_CAST typeOperand=kotlin.Any + GET_VAR 'val tmp_3: kotlin.Any? [val] declared in .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 @@ -106,4 +112,5 @@ FILE fqName: fileName:/elvis.kt then: GET_VAR 'x: kotlin.Any declared in .test5' type=kotlin.Any origin=null BRANCH if: CONST Boolean type=kotlin.Boolean value=true - then: GET_VAR 'val tmp_4: kotlin.Any? [val] declared in .test5' type=kotlin.Any origin=null + then: TYPE_OP type=kotlin.Any origin=IMPLICIT_CAST typeOperand=kotlin.Any + GET_VAR 'val tmp_4: kotlin.Any? [val] declared in .test5' type=kotlin.Any? origin=null diff --git a/compiler/testData/ir/irText/expressions/floatingPointComparisons/comparableWithDoubleOrFloat.fir.txt b/compiler/testData/ir/irText/expressions/floatingPointComparisons/comparableWithDoubleOrFloat.fir.txt deleted file mode 100644 index 25e37df097b..00000000000 --- a/compiler/testData/ir/irText/expressions/floatingPointComparisons/comparableWithDoubleOrFloat.fir.txt +++ /dev/null @@ -1,45 +0,0 @@ -FILE fqName: fileName:/comparableWithDoubleOrFloat.kt - FUN name:testD visibility:public modality:FINAL <> (x:kotlin.Comparable, y:kotlin.Comparable) returnType:kotlin.Boolean - VALUE_PARAMETER name:x index:0 type:kotlin.Comparable - VALUE_PARAMETER name:y index:1 type:kotlin.Comparable - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testD (x: kotlin.Comparable, y: kotlin.Comparable): kotlin.Boolean declared in ' - WHEN type=kotlin.Boolean origin=ANDAND - BRANCH - if: WHEN type=kotlin.Boolean origin=ANDAND - BRANCH - if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double - GET_VAR 'x: kotlin.Comparable declared in .testD' type=kotlin.Comparable origin=null - then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double - GET_VAR 'y: kotlin.Comparable declared in .testD' type=kotlin.Comparable origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST Boolean type=kotlin.Boolean value=false - then: CALL 'public final fun less (arg0: kotlin.Double, arg1: kotlin.Double): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=LT - arg0: GET_VAR 'x: kotlin.Comparable declared in .testD' type=kotlin.Double origin=null - arg1: GET_VAR 'y: kotlin.Comparable declared in .testD' type=kotlin.Double origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST Boolean type=kotlin.Boolean value=false - FUN name:testF visibility:public modality:FINAL <> (x:kotlin.Comparable, y:kotlin.Comparable) returnType:kotlin.Boolean - VALUE_PARAMETER name:x index:0 type:kotlin.Comparable - VALUE_PARAMETER name:y index:1 type:kotlin.Comparable - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testF (x: kotlin.Comparable, y: kotlin.Comparable): kotlin.Boolean declared in ' - WHEN type=kotlin.Boolean origin=ANDAND - BRANCH - if: WHEN type=kotlin.Boolean origin=ANDAND - BRANCH - if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float - GET_VAR 'x: kotlin.Comparable declared in .testF' type=kotlin.Comparable origin=null - then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float - GET_VAR 'y: kotlin.Comparable declared in .testF' type=kotlin.Comparable origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST Boolean type=kotlin.Boolean value=false - then: CALL 'public final fun less (arg0: kotlin.Float, arg1: kotlin.Float): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=LT - arg0: GET_VAR 'x: kotlin.Comparable declared in .testF' type=kotlin.Float origin=null - arg1: GET_VAR 'y: kotlin.Comparable declared in .testF' type=kotlin.Float origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST Boolean type=kotlin.Boolean value=false diff --git a/compiler/testData/ir/irText/expressions/floatingPointComparisons/comparableWithDoubleOrFloat.kt b/compiler/testData/ir/irText/expressions/floatingPointComparisons/comparableWithDoubleOrFloat.kt index 0c1cc53e4ce..90d632ec3c6 100644 --- a/compiler/testData/ir/irText/expressions/floatingPointComparisons/comparableWithDoubleOrFloat.kt +++ b/compiler/testData/ir/irText/expressions/floatingPointComparisons/comparableWithDoubleOrFloat.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL fun testD(x: Comparable, y: Comparable) = x is Double && y is Double && x < y fun testF(x: Comparable, y: Comparable) = x is Float && y is Float && x < y \ No newline at end of file diff --git a/compiler/testData/ir/irText/expressions/floatingPointComparisons/eqeqRhsConditionPossiblyAffectingLhs.fir.txt b/compiler/testData/ir/irText/expressions/floatingPointComparisons/eqeqRhsConditionPossiblyAffectingLhs.fir.txt deleted file mode 100644 index 479d79ca02c..00000000000 --- a/compiler/testData/ir/irText/expressions/floatingPointComparisons/eqeqRhsConditionPossiblyAffectingLhs.fir.txt +++ /dev/null @@ -1,17 +0,0 @@ -FILE fqName: fileName:/eqeqRhsConditionPossiblyAffectingLhs.kt - FUN name:test visibility:public modality:FINAL <> (x:kotlin.Any) returnType:kotlin.Boolean - VALUE_PARAMETER name:x index:0 type:kotlin.Any - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test (x: kotlin.Any): kotlin.Boolean declared in ' - 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.Any declared in .test' type=kotlin.Any origin=null - arg1: WHEN type=kotlin.Double origin=IF - BRANCH - if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=kotlin.Double - GET_VAR 'x: kotlin.Any declared in .test' type=kotlin.Any origin=null - then: CALL 'public final fun CHECK_NOT_NULL (arg0: T0 of kotlin.internal.ir.CHECK_NOT_NULL?): T0 of kotlin.internal.ir.CHECK_NOT_NULL declared in kotlin.internal.ir' type=kotlin.Nothing origin=EXCLEXCL - : kotlin.Nothing - arg0: CONST Null type=kotlin.Nothing? value=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: GET_VAR 'x: kotlin.Any declared in .test' type=kotlin.Double origin=null diff --git a/compiler/testData/ir/irText/expressions/floatingPointComparisons/eqeqRhsConditionPossiblyAffectingLhs.kt b/compiler/testData/ir/irText/expressions/floatingPointComparisons/eqeqRhsConditionPossiblyAffectingLhs.kt index ef474386a07..238c5333682 100644 --- a/compiler/testData/ir/irText/expressions/floatingPointComparisons/eqeqRhsConditionPossiblyAffectingLhs.kt +++ b/compiler/testData/ir/irText/expressions/floatingPointComparisons/eqeqRhsConditionPossiblyAffectingLhs.kt @@ -1,2 +1,4 @@ +// FIR_IDENTICAL + fun test(x: Any) = x == (if (x !is Double) null!! else x) \ No newline at end of file diff --git a/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointCompareTo.fir.txt b/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointCompareTo.fir.txt deleted file mode 100644 index 6f42022f19b..00000000000 --- a/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointCompareTo.fir.txt +++ /dev/null @@ -1,189 +0,0 @@ -FILE fqName: fileName:/floatingPointCompareTo.kt - FUN name:test1d visibility:public modality:FINAL <> (x:kotlin.Double, y:kotlin.Double) returnType:kotlin.Int - VALUE_PARAMETER name:x index:0 type:kotlin.Double - VALUE_PARAMETER name:y index:1 type:kotlin.Double - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test1d (x: kotlin.Double, y: kotlin.Double): kotlin.Int declared in ' - CALL 'public open fun compareTo (other: kotlin.Double): kotlin.Int [operator] declared in kotlin.Double' type=kotlin.Int origin=null - $this: GET_VAR 'x: kotlin.Double declared in .test1d' type=kotlin.Double origin=null - other: GET_VAR 'y: kotlin.Double declared in .test1d' type=kotlin.Double origin=null - FUN name:test2d visibility:public modality:FINAL <> (x:kotlin.Double, y:kotlin.Any) returnType:kotlin.Boolean - VALUE_PARAMETER name:x index:0 type:kotlin.Double - VALUE_PARAMETER name:y index:1 type:kotlin.Any - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test2d (x: kotlin.Double, y: kotlin.Any): kotlin.Boolean declared in ' - WHEN type=kotlin.Boolean origin=ANDAND - BRANCH - if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double - GET_VAR 'y: kotlin.Any declared in .test2d' type=kotlin.Any origin=null - then: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: CALL 'public open fun compareTo (other: kotlin.Double): kotlin.Int [operator] declared in kotlin.Double' type=kotlin.Int origin=null - $this: GET_VAR 'x: kotlin.Double declared in .test2d' type=kotlin.Double origin=null - other: GET_VAR 'y: kotlin.Any declared in .test2d' type=kotlin.Double origin=null - arg1: CONST Int type=kotlin.Int value=0 - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST Boolean type=kotlin.Boolean value=false - FUN name:test3d visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:kotlin.Boolean - VALUE_PARAMETER name:x index:0 type:kotlin.Any - VALUE_PARAMETER name:y index:1 type:kotlin.Any - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test3d (x: kotlin.Any, y: kotlin.Any): kotlin.Boolean declared in ' - WHEN type=kotlin.Boolean origin=ANDAND - BRANCH - if: WHEN type=kotlin.Boolean origin=ANDAND - BRANCH - if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double - GET_VAR 'x: kotlin.Any declared in .test3d' type=kotlin.Any origin=null - then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double - GET_VAR 'y: kotlin.Any declared in .test3d' type=kotlin.Any origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST Boolean type=kotlin.Boolean value=false - then: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: CALL 'public open fun compareTo (other: kotlin.Double): kotlin.Int [operator] declared in kotlin.Double' type=kotlin.Int origin=null - $this: GET_VAR 'x: kotlin.Any declared in .test3d' type=kotlin.Double origin=null - other: GET_VAR 'y: kotlin.Any declared in .test3d' type=kotlin.Double origin=null - arg1: CONST Int type=kotlin.Int value=0 - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST Boolean type=kotlin.Boolean value=false - FUN name:test1f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Float) returnType:kotlin.Int - VALUE_PARAMETER name:x index:0 type:kotlin.Float - VALUE_PARAMETER name:y index:1 type:kotlin.Float - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test1f (x: kotlin.Float, y: kotlin.Float): kotlin.Int declared in ' - CALL 'public open fun compareTo (other: kotlin.Float): kotlin.Int [operator] declared in kotlin.Float' type=kotlin.Int origin=null - $this: GET_VAR 'x: kotlin.Float declared in .test1f' type=kotlin.Float origin=null - other: GET_VAR 'y: kotlin.Float declared in .test1f' type=kotlin.Float origin=null - FUN name:test2f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Any) returnType:kotlin.Boolean - VALUE_PARAMETER name:x index:0 type:kotlin.Float - VALUE_PARAMETER name:y index:1 type:kotlin.Any - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test2f (x: kotlin.Float, y: kotlin.Any): kotlin.Boolean declared in ' - WHEN type=kotlin.Boolean origin=ANDAND - BRANCH - if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float - GET_VAR 'y: kotlin.Any declared in .test2f' type=kotlin.Any origin=null - then: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: CALL 'public open fun compareTo (other: kotlin.Float): kotlin.Int [operator] declared in kotlin.Float' type=kotlin.Int origin=null - $this: GET_VAR 'x: kotlin.Float declared in .test2f' type=kotlin.Float origin=null - other: GET_VAR 'y: kotlin.Any declared in .test2f' type=kotlin.Float origin=null - arg1: CONST Int type=kotlin.Int value=0 - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST Boolean type=kotlin.Boolean value=false - FUN name:test3f visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:kotlin.Boolean - VALUE_PARAMETER name:x index:0 type:kotlin.Any - VALUE_PARAMETER name:y index:1 type:kotlin.Any - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test3f (x: kotlin.Any, y: kotlin.Any): kotlin.Boolean declared in ' - WHEN type=kotlin.Boolean origin=ANDAND - BRANCH - if: WHEN type=kotlin.Boolean origin=ANDAND - BRANCH - if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float - GET_VAR 'x: kotlin.Any declared in .test3f' type=kotlin.Any origin=null - then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float - GET_VAR 'y: kotlin.Any declared in .test3f' type=kotlin.Any origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST Boolean type=kotlin.Boolean value=false - then: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: CALL 'public open fun compareTo (other: kotlin.Float): kotlin.Int [operator] declared in kotlin.Float' type=kotlin.Int origin=null - $this: GET_VAR 'x: kotlin.Any declared in .test3f' type=kotlin.Float origin=null - other: GET_VAR 'y: kotlin.Any declared in .test3f' type=kotlin.Float origin=null - arg1: CONST Int type=kotlin.Int value=0 - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST Boolean type=kotlin.Boolean value=false - FUN name:testFD visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:kotlin.Boolean - VALUE_PARAMETER name:x index:0 type:kotlin.Any - VALUE_PARAMETER name:y index:1 type:kotlin.Any - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testFD (x: kotlin.Any, y: kotlin.Any): kotlin.Boolean declared in ' - WHEN type=kotlin.Boolean origin=ANDAND - BRANCH - if: WHEN type=kotlin.Boolean origin=ANDAND - BRANCH - if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float - GET_VAR 'x: kotlin.Any declared in .testFD' type=kotlin.Any origin=null - then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double - GET_VAR 'y: kotlin.Any declared in .testFD' type=kotlin.Any origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST Boolean type=kotlin.Boolean value=false - then: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: CALL 'public final fun compareTo (other: kotlin.Double): kotlin.Int [operator] declared in kotlin.Float' type=kotlin.Int origin=null - $this: GET_VAR 'x: kotlin.Any declared in .testFD' type=kotlin.Float origin=null - other: GET_VAR 'y: kotlin.Any declared in .testFD' type=kotlin.Double origin=null - arg1: CONST Int type=kotlin.Int value=0 - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST Boolean type=kotlin.Boolean value=false - FUN name:testDF visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:kotlin.Boolean - VALUE_PARAMETER name:x index:0 type:kotlin.Any - VALUE_PARAMETER name:y index:1 type:kotlin.Any - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testDF (x: kotlin.Any, y: kotlin.Any): kotlin.Boolean declared in ' - WHEN type=kotlin.Boolean origin=ANDAND - BRANCH - if: WHEN type=kotlin.Boolean origin=ANDAND - BRANCH - if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double - GET_VAR 'x: kotlin.Any declared in .testDF' type=kotlin.Any origin=null - then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float - GET_VAR 'y: kotlin.Any declared in .testDF' type=kotlin.Any origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST Boolean type=kotlin.Boolean value=false - then: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: CALL 'public final fun compareTo (other: kotlin.Float): kotlin.Int [operator] declared in kotlin.Double' type=kotlin.Int origin=null - $this: GET_VAR 'x: kotlin.Any declared in .testDF' type=kotlin.Double origin=null - other: GET_VAR 'y: kotlin.Any declared in .testDF' type=kotlin.Float origin=null - arg1: CONST Int type=kotlin.Int value=0 - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST Boolean type=kotlin.Boolean value=false - FUN name:test1fr visibility:public modality:FINAL <> ($receiver:kotlin.Float, x:kotlin.Float) returnType:kotlin.Int - $receiver: VALUE_PARAMETER name: type:kotlin.Float - VALUE_PARAMETER name:x index:0 type:kotlin.Float - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test1fr (x: kotlin.Float): kotlin.Int declared in ' - CALL 'public open fun compareTo (other: kotlin.Float): kotlin.Int [operator] declared in kotlin.Float' type=kotlin.Int origin=null - $this: GET_VAR ': kotlin.Float declared in .test1fr' type=kotlin.Float origin=null - other: GET_VAR 'x: kotlin.Float declared in .test1fr' type=kotlin.Float origin=null - FUN name:test2fr visibility:public modality:FINAL <> ($receiver:kotlin.Float, x:kotlin.Any) returnType:kotlin.Boolean - $receiver: VALUE_PARAMETER name: type:kotlin.Float - VALUE_PARAMETER name:x index:0 type:kotlin.Any - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test2fr (x: kotlin.Any): kotlin.Boolean declared in ' - WHEN type=kotlin.Boolean origin=ANDAND - BRANCH - if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float - GET_VAR 'x: kotlin.Any declared in .test2fr' type=kotlin.Any origin=null - then: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: CALL 'public open fun compareTo (other: kotlin.Float): kotlin.Int [operator] declared in kotlin.Float' type=kotlin.Int origin=null - $this: GET_VAR ': kotlin.Float declared in .test2fr' type=kotlin.Float origin=null - other: GET_VAR 'x: kotlin.Any declared in .test2fr' type=kotlin.Float origin=null - arg1: CONST Int type=kotlin.Int value=0 - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST Boolean type=kotlin.Boolean value=false - FUN name:test3fr visibility:public modality:FINAL <> ($receiver:kotlin.Float, x:kotlin.Any) returnType:kotlin.Boolean - $receiver: VALUE_PARAMETER name: type:kotlin.Float - VALUE_PARAMETER name:x index:0 type:kotlin.Any - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test3fr (x: kotlin.Any): kotlin.Boolean declared in ' - WHEN type=kotlin.Boolean origin=ANDAND - BRANCH - if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double - GET_VAR 'x: kotlin.Any declared in .test3fr' type=kotlin.Any origin=null - then: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: CALL 'public final fun compareTo (other: kotlin.Double): kotlin.Int [operator] declared in kotlin.Float' type=kotlin.Int origin=null - $this: GET_VAR ': kotlin.Float declared in .test3fr' type=kotlin.Float origin=null - other: GET_VAR 'x: kotlin.Any declared in .test3fr' type=kotlin.Double origin=null - arg1: CONST Int type=kotlin.Int value=0 - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST Boolean type=kotlin.Boolean value=false diff --git a/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointCompareTo.kt b/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointCompareTo.kt index f4f8b1af849..9bd883d9815 100644 --- a/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointCompareTo.kt +++ b/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointCompareTo.kt @@ -1,3 +1,5 @@ +// FIR_IDENTICAL + fun test1d(x: Double, y: Double) = x.compareTo(y) fun test2d(x: Double, y: Any) = y is Double && x.compareTo(y) == 0 fun test3d(x: Any, y: Any) = x is Double && y is Double && x.compareTo(y) == 0 diff --git a/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointEqeq.fir.txt b/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointEqeq.fir.txt index 8981be73e3b..952dc49121e 100644 --- a/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointEqeq.fir.txt +++ b/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointEqeq.fir.txt @@ -42,7 +42,8 @@ FILE fqName: fileName:/floatingPointEqeq.kt GET_VAR 'y: kotlin.Any declared in .test5d' type=kotlin.Any origin=null then: 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.Double declared in .test5d' type=kotlin.Double origin=null - arg1: GET_VAR 'y: kotlin.Any declared in .test5d' type=kotlin.Double origin=null + arg1: TYPE_OP type=kotlin.Double origin=IMPLICIT_CAST typeOperand=kotlin.Double + GET_VAR 'y: kotlin.Any declared in .test5d' type=kotlin.Any origin=null BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST Boolean type=kotlin.Boolean value=false @@ -63,8 +64,10 @@ FILE fqName: fileName:/floatingPointEqeq.kt if: CONST Boolean type=kotlin.Boolean value=true then: CONST Boolean type=kotlin.Boolean value=false then: 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.Any declared in .test6d' type=kotlin.Double origin=null - arg1: GET_VAR 'y: kotlin.Any declared in .test6d' type=kotlin.Double origin=null + arg0: TYPE_OP type=kotlin.Double origin=IMPLICIT_CAST typeOperand=kotlin.Double + GET_VAR 'x: kotlin.Any declared in .test6d' type=kotlin.Any origin=null + arg1: TYPE_OP type=kotlin.Double origin=IMPLICIT_CAST typeOperand=kotlin.Double + GET_VAR 'y: kotlin.Any declared in .test6d' type=kotlin.Any origin=null BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST Boolean type=kotlin.Boolean value=false @@ -111,7 +114,8 @@ FILE fqName: fileName:/floatingPointEqeq.kt GET_VAR 'y: kotlin.Any declared in .test5f' type=kotlin.Any origin=null then: 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.Float declared in .test5f' type=kotlin.Float origin=null - arg1: GET_VAR 'y: kotlin.Any declared in .test5f' type=kotlin.Float origin=null + arg1: TYPE_OP type=kotlin.Float origin=IMPLICIT_CAST typeOperand=kotlin.Float + GET_VAR 'y: kotlin.Any declared in .test5f' type=kotlin.Any origin=null BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST Boolean type=kotlin.Boolean value=false @@ -132,8 +136,10 @@ FILE fqName: fileName:/floatingPointEqeq.kt if: CONST Boolean type=kotlin.Boolean value=true then: CONST Boolean type=kotlin.Boolean value=false then: 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.Any declared in .test6f' type=kotlin.Float origin=null - arg1: GET_VAR 'y: kotlin.Any declared in .test6f' type=kotlin.Float origin=null + arg0: TYPE_OP type=kotlin.Float origin=IMPLICIT_CAST typeOperand=kotlin.Float + GET_VAR 'x: kotlin.Any declared in .test6f' type=kotlin.Any origin=null + arg1: TYPE_OP type=kotlin.Float origin=IMPLICIT_CAST typeOperand=kotlin.Float + GET_VAR 'y: kotlin.Any declared in .test6f' type=kotlin.Any origin=null BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST Boolean type=kotlin.Boolean value=false @@ -154,8 +160,10 @@ FILE fqName: fileName:/floatingPointEqeq.kt if: CONST Boolean type=kotlin.Boolean value=true then: CONST Boolean type=kotlin.Boolean value=false then: 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.Any declared in .testFD' type=kotlin.Float origin=null - arg1: GET_VAR 'y: kotlin.Any declared in .testFD' type=kotlin.Double origin=null + arg0: TYPE_OP type=kotlin.Float origin=IMPLICIT_CAST typeOperand=kotlin.Float + GET_VAR 'x: kotlin.Any declared in .testFD' type=kotlin.Any origin=null + arg1: TYPE_OP type=kotlin.Double origin=IMPLICIT_CAST typeOperand=kotlin.Double + GET_VAR 'y: kotlin.Any declared in .testFD' type=kotlin.Any origin=null BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST Boolean type=kotlin.Boolean value=false @@ -176,8 +184,10 @@ FILE fqName: fileName:/floatingPointEqeq.kt if: CONST Boolean type=kotlin.Boolean value=true then: CONST Boolean type=kotlin.Boolean value=false then: 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.Any declared in .testDF' type=kotlin.Double origin=null - arg1: GET_VAR 'y: kotlin.Any declared in .testDF' type=kotlin.Float origin=null + arg0: TYPE_OP type=kotlin.Double origin=IMPLICIT_CAST typeOperand=kotlin.Double + GET_VAR 'x: kotlin.Any declared in .testDF' type=kotlin.Any origin=null + arg1: TYPE_OP type=kotlin.Float origin=IMPLICIT_CAST typeOperand=kotlin.Float + GET_VAR 'y: kotlin.Any declared in .testDF' type=kotlin.Any origin=null BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST Boolean type=kotlin.Boolean value=false diff --git a/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointEquals.fir.txt b/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointEquals.fir.txt index c759f338987..f55cf0a5762 100644 --- a/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointEquals.fir.txt +++ b/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointEquals.fir.txt @@ -42,7 +42,8 @@ FILE fqName: fileName:/floatingPointEquals.kt GET_VAR 'y: kotlin.Any declared in .test5d' type=kotlin.Any origin=null then: CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any' type=kotlin.Boolean origin=null $this: GET_VAR 'x: kotlin.Double declared in .test5d' type=kotlin.Double origin=null - other: GET_VAR 'y: kotlin.Any declared in .test5d' type=kotlin.Double origin=null + other: TYPE_OP type=kotlin.Double origin=IMPLICIT_CAST typeOperand=kotlin.Double + GET_VAR 'y: kotlin.Any declared in .test5d' type=kotlin.Any origin=null BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST Boolean type=kotlin.Boolean value=false @@ -63,8 +64,10 @@ FILE fqName: fileName:/floatingPointEquals.kt if: CONST Boolean type=kotlin.Boolean value=true then: CONST Boolean type=kotlin.Boolean value=false then: CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any' type=kotlin.Boolean origin=null - $this: GET_VAR 'x: kotlin.Any declared in .test6d' type=kotlin.Double origin=null - other: GET_VAR 'y: kotlin.Any declared in .test6d' type=kotlin.Double origin=null + $this: TYPE_OP type=kotlin.Double origin=IMPLICIT_CAST typeOperand=kotlin.Double + GET_VAR 'x: kotlin.Any declared in .test6d' type=kotlin.Any origin=null + other: TYPE_OP type=kotlin.Double origin=IMPLICIT_CAST typeOperand=kotlin.Double + GET_VAR 'y: kotlin.Any declared in .test6d' type=kotlin.Any origin=null BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST Boolean type=kotlin.Boolean value=false @@ -111,7 +114,8 @@ FILE fqName: fileName:/floatingPointEquals.kt GET_VAR 'y: kotlin.Any declared in .test5f' type=kotlin.Any origin=null then: CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any' type=kotlin.Boolean origin=null $this: GET_VAR 'x: kotlin.Float declared in .test5f' type=kotlin.Float origin=null - other: GET_VAR 'y: kotlin.Any declared in .test5f' type=kotlin.Float origin=null + other: TYPE_OP type=kotlin.Float origin=IMPLICIT_CAST typeOperand=kotlin.Float + GET_VAR 'y: kotlin.Any declared in .test5f' type=kotlin.Any origin=null BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST Boolean type=kotlin.Boolean value=false @@ -132,8 +136,10 @@ FILE fqName: fileName:/floatingPointEquals.kt if: CONST Boolean type=kotlin.Boolean value=true then: CONST Boolean type=kotlin.Boolean value=false then: CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any' type=kotlin.Boolean origin=null - $this: GET_VAR 'x: kotlin.Any declared in .test6f' type=kotlin.Float origin=null - other: GET_VAR 'y: kotlin.Any declared in .test6f' type=kotlin.Float origin=null + $this: TYPE_OP type=kotlin.Float origin=IMPLICIT_CAST typeOperand=kotlin.Float + GET_VAR 'x: kotlin.Any declared in .test6f' type=kotlin.Any origin=null + other: TYPE_OP type=kotlin.Float origin=IMPLICIT_CAST typeOperand=kotlin.Float + GET_VAR 'y: kotlin.Any declared in .test6f' type=kotlin.Any origin=null BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST Boolean type=kotlin.Boolean value=false @@ -154,8 +160,10 @@ FILE fqName: fileName:/floatingPointEquals.kt if: CONST Boolean type=kotlin.Boolean value=true then: CONST Boolean type=kotlin.Boolean value=false then: CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any' type=kotlin.Boolean origin=null - $this: GET_VAR 'x: kotlin.Any declared in .testFD' type=kotlin.Float origin=null - other: GET_VAR 'y: kotlin.Any declared in .testFD' type=kotlin.Double origin=null + $this: TYPE_OP type=kotlin.Float origin=IMPLICIT_CAST typeOperand=kotlin.Float + GET_VAR 'x: kotlin.Any declared in .testFD' type=kotlin.Any origin=null + other: TYPE_OP type=kotlin.Double origin=IMPLICIT_CAST typeOperand=kotlin.Double + GET_VAR 'y: kotlin.Any declared in .testFD' type=kotlin.Any origin=null BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST Boolean type=kotlin.Boolean value=false @@ -176,8 +184,10 @@ FILE fqName: fileName:/floatingPointEquals.kt if: CONST Boolean type=kotlin.Boolean value=true then: CONST Boolean type=kotlin.Boolean value=false then: CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any' type=kotlin.Boolean origin=null - $this: GET_VAR 'x: kotlin.Any declared in .testDF' type=kotlin.Double origin=null - other: GET_VAR 'y: kotlin.Any declared in .testDF' type=kotlin.Float origin=null + $this: TYPE_OP type=kotlin.Double origin=IMPLICIT_CAST typeOperand=kotlin.Double + GET_VAR 'x: kotlin.Any declared in .testDF' type=kotlin.Any origin=null + other: TYPE_OP type=kotlin.Float origin=IMPLICIT_CAST typeOperand=kotlin.Float + GET_VAR 'y: kotlin.Any declared in .testDF' type=kotlin.Any origin=null BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST Boolean type=kotlin.Boolean value=false @@ -224,7 +234,8 @@ FILE fqName: fileName:/floatingPointEquals.kt GET_VAR 'x: kotlin.Any declared in .test5fr' type=kotlin.Any origin=null then: CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any' type=kotlin.Boolean origin=null $this: GET_VAR ': kotlin.Float declared in .test5fr' type=kotlin.Float origin=null - other: GET_VAR 'x: kotlin.Any declared in .test5fr' type=kotlin.Float origin=null + other: TYPE_OP type=kotlin.Float origin=IMPLICIT_CAST typeOperand=kotlin.Float + GET_VAR 'x: kotlin.Any declared in .test5fr' type=kotlin.Any origin=null BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST Boolean type=kotlin.Boolean value=false @@ -239,7 +250,8 @@ FILE fqName: fileName:/floatingPointEquals.kt GET_VAR 'x: kotlin.Any declared in .test6fr' type=kotlin.Any origin=null then: CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any' type=kotlin.Boolean origin=null $this: GET_VAR ': kotlin.Float declared in .test6fr' type=kotlin.Float origin=null - other: GET_VAR 'x: kotlin.Any declared in .test6fr' type=kotlin.Double origin=null + other: TYPE_OP type=kotlin.Double origin=IMPLICIT_CAST typeOperand=kotlin.Double + GET_VAR 'x: kotlin.Any declared in .test6fr' type=kotlin.Any origin=null BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST Boolean type=kotlin.Boolean value=false diff --git a/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointExcleq.fir.txt b/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointExcleq.fir.txt index 253f8d55ba3..b1de33c5e5a 100644 --- a/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointExcleq.fir.txt +++ b/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointExcleq.fir.txt @@ -47,7 +47,8 @@ FILE fqName: fileName:/floatingPointExcleq.kt 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: GET_VAR 'x: kotlin.Double declared in .test5d' type=kotlin.Double origin=null - arg1: GET_VAR 'y: kotlin.Any declared in .test5d' type=kotlin.Double origin=null + arg1: TYPE_OP type=kotlin.Double origin=IMPLICIT_CAST typeOperand=kotlin.Double + GET_VAR 'y: kotlin.Any declared in .test5d' type=kotlin.Any origin=null BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST Boolean type=kotlin.Boolean value=false @@ -69,8 +70,10 @@ FILE fqName: fileName:/floatingPointExcleq.kt then: CONST Boolean type=kotlin.Boolean value=false 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: GET_VAR 'x: kotlin.Any declared in .test6d' type=kotlin.Double origin=null - arg1: GET_VAR 'y: kotlin.Any declared in .test6d' type=kotlin.Double origin=null + arg0: TYPE_OP type=kotlin.Double origin=IMPLICIT_CAST typeOperand=kotlin.Double + GET_VAR 'x: kotlin.Any declared in .test6d' type=kotlin.Any origin=null + arg1: TYPE_OP type=kotlin.Double origin=IMPLICIT_CAST typeOperand=kotlin.Double + GET_VAR 'y: kotlin.Any declared in .test6d' type=kotlin.Any origin=null BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST Boolean type=kotlin.Boolean value=false @@ -122,7 +125,8 @@ FILE fqName: fileName:/floatingPointExcleq.kt 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: GET_VAR 'x: kotlin.Float declared in .test5f' type=kotlin.Float origin=null - arg1: GET_VAR 'y: kotlin.Any declared in .test5f' type=kotlin.Float origin=null + arg1: TYPE_OP type=kotlin.Float origin=IMPLICIT_CAST typeOperand=kotlin.Float + GET_VAR 'y: kotlin.Any declared in .test5f' type=kotlin.Any origin=null BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST Boolean type=kotlin.Boolean value=false @@ -144,8 +148,10 @@ FILE fqName: fileName:/floatingPointExcleq.kt then: CONST Boolean type=kotlin.Boolean value=false 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: GET_VAR 'x: kotlin.Any declared in .test6f' type=kotlin.Float origin=null - arg1: GET_VAR 'y: kotlin.Any declared in .test6f' type=kotlin.Float origin=null + arg0: TYPE_OP type=kotlin.Float origin=IMPLICIT_CAST typeOperand=kotlin.Float + GET_VAR 'x: kotlin.Any declared in .test6f' type=kotlin.Any origin=null + arg1: TYPE_OP type=kotlin.Float origin=IMPLICIT_CAST typeOperand=kotlin.Float + GET_VAR 'y: kotlin.Any declared in .test6f' type=kotlin.Any origin=null BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST Boolean type=kotlin.Boolean value=false @@ -167,8 +173,10 @@ FILE fqName: fileName:/floatingPointExcleq.kt then: CONST Boolean type=kotlin.Boolean value=false 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: GET_VAR 'x: kotlin.Any declared in .testFD' type=kotlin.Float origin=null - arg1: GET_VAR 'y: kotlin.Any declared in .testFD' type=kotlin.Double origin=null + arg0: TYPE_OP type=kotlin.Float origin=IMPLICIT_CAST typeOperand=kotlin.Float + GET_VAR 'x: kotlin.Any declared in .testFD' type=kotlin.Any origin=null + arg1: TYPE_OP type=kotlin.Double origin=IMPLICIT_CAST typeOperand=kotlin.Double + GET_VAR 'y: kotlin.Any declared in .testFD' type=kotlin.Any origin=null BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST Boolean type=kotlin.Boolean value=false @@ -190,8 +198,10 @@ FILE fqName: fileName:/floatingPointExcleq.kt then: CONST Boolean type=kotlin.Boolean value=false 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: GET_VAR 'x: kotlin.Any declared in .testDF' type=kotlin.Double origin=null - arg1: GET_VAR 'y: kotlin.Any declared in .testDF' type=kotlin.Float origin=null + arg0: TYPE_OP type=kotlin.Double origin=IMPLICIT_CAST typeOperand=kotlin.Double + GET_VAR 'x: kotlin.Any declared in .testDF' type=kotlin.Any origin=null + arg1: TYPE_OP type=kotlin.Float origin=IMPLICIT_CAST typeOperand=kotlin.Float + GET_VAR 'y: kotlin.Any declared in .testDF' type=kotlin.Any origin=null BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST Boolean type=kotlin.Boolean value=false diff --git a/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointLess.fir.txt b/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointLess.fir.txt index 666bc7f0883..416426b4cb4 100644 --- a/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointLess.fir.txt +++ b/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointLess.fir.txt @@ -18,7 +18,8 @@ FILE fqName: fileName:/floatingPointLess.kt GET_VAR 'y: kotlin.Any declared in .test2d' type=kotlin.Any origin=null then: CALL 'public final fun less (arg0: kotlin.Double, arg1: kotlin.Double): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=LT arg0: GET_VAR 'x: kotlin.Double declared in .test2d' type=kotlin.Double origin=null - arg1: GET_VAR 'y: kotlin.Any declared in .test2d' type=kotlin.Double origin=null + arg1: TYPE_OP type=kotlin.Double origin=IMPLICIT_CAST typeOperand=kotlin.Double + GET_VAR 'y: kotlin.Any declared in .test2d' type=kotlin.Any origin=null BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST Boolean type=kotlin.Boolean value=false @@ -39,8 +40,10 @@ FILE fqName: fileName:/floatingPointLess.kt if: CONST Boolean type=kotlin.Boolean value=true then: CONST Boolean type=kotlin.Boolean value=false then: CALL 'public final fun less (arg0: kotlin.Double, arg1: kotlin.Double): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=LT - arg0: GET_VAR 'x: kotlin.Any declared in .test3d' type=kotlin.Double origin=null - arg1: GET_VAR 'y: kotlin.Any declared in .test3d' type=kotlin.Double origin=null + arg0: TYPE_OP type=kotlin.Double origin=IMPLICIT_CAST typeOperand=kotlin.Double + GET_VAR 'x: kotlin.Any declared in .test3d' type=kotlin.Any origin=null + arg1: TYPE_OP type=kotlin.Double origin=IMPLICIT_CAST typeOperand=kotlin.Double + GET_VAR 'y: kotlin.Any declared in .test3d' type=kotlin.Any origin=null BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST Boolean type=kotlin.Boolean value=false @@ -63,7 +66,8 @@ FILE fqName: fileName:/floatingPointLess.kt GET_VAR 'y: kotlin.Any declared in .test2f' type=kotlin.Any origin=null then: CALL 'public final fun less (arg0: kotlin.Float, arg1: kotlin.Float): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=LT arg0: GET_VAR 'x: kotlin.Float declared in .test2f' type=kotlin.Float origin=null - arg1: GET_VAR 'y: kotlin.Any declared in .test2f' type=kotlin.Float origin=null + arg1: TYPE_OP type=kotlin.Float origin=IMPLICIT_CAST typeOperand=kotlin.Float + GET_VAR 'y: kotlin.Any declared in .test2f' type=kotlin.Any origin=null BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST Boolean type=kotlin.Boolean value=false @@ -84,8 +88,10 @@ FILE fqName: fileName:/floatingPointLess.kt if: CONST Boolean type=kotlin.Boolean value=true then: CONST Boolean type=kotlin.Boolean value=false then: CALL 'public final fun less (arg0: kotlin.Float, arg1: kotlin.Float): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=LT - arg0: GET_VAR 'x: kotlin.Any declared in .test3f' type=kotlin.Float origin=null - arg1: GET_VAR 'y: kotlin.Any declared in .test3f' type=kotlin.Float origin=null + arg0: TYPE_OP type=kotlin.Float origin=IMPLICIT_CAST typeOperand=kotlin.Float + GET_VAR 'x: kotlin.Any declared in .test3f' type=kotlin.Any origin=null + arg1: TYPE_OP type=kotlin.Float origin=IMPLICIT_CAST typeOperand=kotlin.Float + GET_VAR 'y: kotlin.Any declared in .test3f' type=kotlin.Any origin=null BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST Boolean type=kotlin.Boolean value=false diff --git a/compiler/testData/ir/irText/expressions/floatingPointComparisons/nullableFloatingPointEqeq.fir.txt b/compiler/testData/ir/irText/expressions/floatingPointComparisons/nullableFloatingPointEqeq.fir.txt index fdb10bc7c55..5d357bf9016 100644 --- a/compiler/testData/ir/irText/expressions/floatingPointComparisons/nullableFloatingPointEqeq.fir.txt +++ b/compiler/testData/ir/irText/expressions/floatingPointComparisons/nullableFloatingPointEqeq.fir.txt @@ -18,7 +18,8 @@ FILE fqName: fileName:/nullableFloatingPointEqeq.kt GET_VAR 'y: kotlin.Any? declared in .testDF' type=kotlin.Any? origin=null then: 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.Double? declared in .testDF' type=kotlin.Double? origin=null - arg1: GET_VAR 'y: kotlin.Any? declared in .testDF' type=kotlin.Float? origin=null + arg1: TYPE_OP type=kotlin.Float? origin=IMPLICIT_CAST typeOperand=kotlin.Float? + GET_VAR 'y: kotlin.Any? declared in .testDF' type=kotlin.Any? origin=null BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST Boolean type=kotlin.Boolean value=false @@ -33,7 +34,8 @@ FILE fqName: fileName:/nullableFloatingPointEqeq.kt GET_VAR 'y: kotlin.Any? declared in .testDI' type=kotlin.Any? origin=null then: 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.Double? declared in .testDI' type=kotlin.Double? origin=null - arg1: GET_VAR 'y: kotlin.Any? declared in .testDI' type=kotlin.Int? origin=null + arg1: TYPE_OP type=kotlin.Int? origin=IMPLICIT_CAST typeOperand=kotlin.Int? + GET_VAR 'y: kotlin.Any? declared in .testDI' type=kotlin.Any? origin=null BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST Boolean type=kotlin.Boolean value=false @@ -54,8 +56,10 @@ FILE fqName: fileName:/nullableFloatingPointEqeq.kt if: CONST Boolean type=kotlin.Boolean value=true then: CONST Boolean type=kotlin.Boolean value=false then: 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.Any? declared in .testDI2' type=kotlin.Int? origin=null - arg1: GET_VAR 'y: kotlin.Any? declared in .testDI2' type=kotlin.Double origin=null + arg0: TYPE_OP type=kotlin.Int? origin=IMPLICIT_CAST typeOperand=kotlin.Int? + GET_VAR 'x: kotlin.Any? declared in .testDI2' type=kotlin.Any? origin=null + arg1: TYPE_OP type=kotlin.Double origin=IMPLICIT_CAST typeOperand=kotlin.Double + GET_VAR 'y: kotlin.Any? declared in .testDI2' type=kotlin.Any? origin=null BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST Boolean type=kotlin.Boolean value=false diff --git a/compiler/testData/ir/irText/expressions/floatingPointComparisons/typeParameterWithPrimitiveNumericSupertype.fir.txt b/compiler/testData/ir/irText/expressions/floatingPointComparisons/typeParameterWithPrimitiveNumericSupertype.fir.txt index 1d98230b839..cb7ee1afc26 100644 --- a/compiler/testData/ir/irText/expressions/floatingPointComparisons/typeParameterWithPrimitiveNumericSupertype.fir.txt +++ b/compiler/testData/ir/irText/expressions/floatingPointComparisons/typeParameterWithPrimitiveNumericSupertype.fir.txt @@ -10,7 +10,8 @@ FILE fqName: fileName:/typeParameterWithPrimitiveNumericSupertype.kt if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Int GET_VAR 'x: kotlin.Any declared in .test0' type=kotlin.Any origin=null then: 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.Any declared in .test0' type=kotlin.Int origin=null + arg0: TYPE_OP type=kotlin.Int origin=IMPLICIT_CAST typeOperand=kotlin.Int + GET_VAR 'x: kotlin.Any declared in .test0' type=kotlin.Any origin=null arg1: GET_VAR 'y: T of .test0 declared in .test0' type=T of .test0 origin=null BRANCH if: CONST Boolean type=kotlin.Boolean value=true @@ -26,7 +27,8 @@ FILE fqName: fileName:/typeParameterWithPrimitiveNumericSupertype.kt if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float GET_VAR 'x: kotlin.Any declared in .test1' type=kotlin.Any origin=null then: 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.Any declared in .test1' type=kotlin.Float origin=null + arg0: TYPE_OP type=kotlin.Float origin=IMPLICIT_CAST typeOperand=kotlin.Float + GET_VAR 'x: kotlin.Any declared in .test1' type=kotlin.Any origin=null arg1: GET_VAR 'y: T of .test1 declared in .test1' type=T of .test1 origin=null BRANCH if: CONST Boolean type=kotlin.Boolean value=true @@ -42,7 +44,8 @@ FILE fqName: fileName:/typeParameterWithPrimitiveNumericSupertype.kt if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float GET_VAR 'x: kotlin.Any declared in .test2' type=kotlin.Any origin=null then: 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.Any declared in .test2' type=kotlin.Float origin=null + arg0: TYPE_OP type=kotlin.Float origin=IMPLICIT_CAST typeOperand=kotlin.Float + GET_VAR 'x: kotlin.Any declared in .test2' type=kotlin.Any origin=null arg1: GET_VAR 'y: T of .test2 declared in .test2' type=T of .test2 origin=null BRANCH if: CONST Boolean type=kotlin.Boolean value=true @@ -58,7 +61,8 @@ FILE fqName: fileName:/typeParameterWithPrimitiveNumericSupertype.kt if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Int GET_VAR 'x: kotlin.Any declared in .test3' type=kotlin.Any origin=null then: 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.Any declared in .test3' type=kotlin.Int origin=null + arg0: TYPE_OP type=kotlin.Int origin=IMPLICIT_CAST typeOperand=kotlin.Int + GET_VAR 'x: kotlin.Any declared in .test3' type=kotlin.Any origin=null arg1: GET_VAR 'y: T of .test3 declared in .test3' type=T of .test3 origin=null BRANCH if: CONST Boolean type=kotlin.Boolean value=true @@ -74,7 +78,8 @@ FILE fqName: fileName:/typeParameterWithPrimitiveNumericSupertype.kt if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Int GET_VAR 'x: kotlin.Any declared in .test4' type=kotlin.Any origin=null then: 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.Any declared in .test4' type=kotlin.Int origin=null + arg0: TYPE_OP type=kotlin.Int origin=IMPLICIT_CAST typeOperand=kotlin.Int + GET_VAR 'x: kotlin.Any declared in .test4' type=kotlin.Any origin=null arg1: GET_VAR 'y: T of .test4 declared in .test4' type=T of .test4 origin=null BRANCH if: CONST Boolean type=kotlin.Boolean value=true @@ -91,7 +96,8 @@ FILE fqName: fileName:/typeParameterWithPrimitiveNumericSupertype.kt if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Int GET_VAR 'x: kotlin.Any declared in .test5' type=kotlin.Any origin=null then: 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.Any declared in .test5' type=kotlin.Int origin=null + arg0: TYPE_OP type=kotlin.Int origin=IMPLICIT_CAST typeOperand=kotlin.Int + GET_VAR 'x: kotlin.Any declared in .test5' type=kotlin.Any origin=null arg1: GET_VAR 'y: R of .test5 declared in .test5' type=R of .test5 origin=null BRANCH if: CONST Boolean type=kotlin.Boolean value=true @@ -107,7 +113,8 @@ FILE fqName: fileName:/typeParameterWithPrimitiveNumericSupertype.kt if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Int GET_VAR 'x: kotlin.Any declared in .test6' type=kotlin.Any origin=null then: 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.Any declared in .test6' type=kotlin.Int origin=null + arg0: TYPE_OP type=kotlin.Int origin=IMPLICIT_CAST typeOperand=kotlin.Int + GET_VAR 'x: kotlin.Any declared in .test6' type=kotlin.Any origin=null arg1: GET_VAR 'y: T of .test6 declared in .test6' type=T of .test6 origin=null BRANCH if: CONST Boolean type=kotlin.Boolean value=true @@ -131,7 +138,8 @@ FILE fqName: fileName:/typeParameterWithPrimitiveNumericSupertype.kt GET_VAR 'y: kotlin.Any declared in .F.testCapturedType' type=kotlin.Any origin=null then: 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 .F declared in .F.testCapturedType' type=T of .F origin=null - arg1: GET_VAR 'y: kotlin.Any declared in .F.testCapturedType' type=kotlin.Double origin=null + arg1: TYPE_OP type=kotlin.Double origin=IMPLICIT_CAST typeOperand=kotlin.Double + GET_VAR 'y: kotlin.Any declared in .F.testCapturedType' type=kotlin.Any origin=null BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST Boolean type=kotlin.Boolean value=false diff --git a/compiler/testData/ir/irText/expressions/floatingPointComparisons/whenByFloatingPoint.fir.txt b/compiler/testData/ir/irText/expressions/floatingPointComparisons/whenByFloatingPoint.fir.txt index 1b23654c812..19826ac79be 100644 --- a/compiler/testData/ir/irText/expressions/floatingPointComparisons/whenByFloatingPoint.fir.txt +++ b/compiler/testData/ir/irText/expressions/floatingPointComparisons/whenByFloatingPoint.fir.txt @@ -28,7 +28,8 @@ FILE fqName: fileName:/whenByFloatingPoint.kt RETURN type=kotlin.Nothing from='public final fun testSmartCastInWhenSubject (x: kotlin.Any): kotlin.Int declared in ' BLOCK type=kotlin.Int origin=WHEN VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.Double [val] - GET_VAR 'x: kotlin.Any declared in .testSmartCastInWhenSubject' type=kotlin.Double origin=null + TYPE_OP type=kotlin.Double origin=IMPLICIT_CAST typeOperand=kotlin.Double + GET_VAR 'x: kotlin.Any declared in .testSmartCastInWhenSubject' type=kotlin.Any origin=null WHEN type=kotlin.Int origin=WHEN 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 @@ -57,7 +58,8 @@ FILE fqName: fileName:/whenByFloatingPoint.kt BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ arg0: GET_VAR 'val tmp_2: kotlin.Double [val] declared in .testSmartCastInWhenCondition' type=kotlin.Double origin=null - arg1: GET_VAR 'y: kotlin.Any declared in .testSmartCastInWhenCondition' type=kotlin.Double origin=null + arg1: TYPE_OP type=kotlin.Double origin=IMPLICIT_CAST typeOperand=kotlin.Double + GET_VAR 'y: kotlin.Any declared in .testSmartCastInWhenCondition' type=kotlin.Any origin=null then: CONST Int type=kotlin.Int value=0 BRANCH if: CONST Boolean type=kotlin.Boolean value=true @@ -104,12 +106,14 @@ FILE fqName: fileName:/whenByFloatingPoint.kt RETURN type=kotlin.Nothing from='public final fun testSmartCastToDifferentTypes (x: kotlin.Any, y: kotlin.Any): kotlin.Int declared in ' BLOCK type=kotlin.Int origin=WHEN VAR IR_TEMPORARY_VARIABLE name:tmp_4 type:kotlin.Double [val] - GET_VAR 'x: kotlin.Any declared in .testSmartCastToDifferentTypes' type=kotlin.Double origin=null + TYPE_OP type=kotlin.Double origin=IMPLICIT_CAST typeOperand=kotlin.Double + GET_VAR 'x: kotlin.Any declared in .testSmartCastToDifferentTypes' type=kotlin.Any origin=null WHEN type=kotlin.Int origin=WHEN BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ arg0: GET_VAR 'val tmp_4: kotlin.Double [val] declared in .testSmartCastToDifferentTypes' type=kotlin.Double origin=null - arg1: GET_VAR 'y: kotlin.Any declared in .testSmartCastToDifferentTypes' type=kotlin.Float origin=null + arg1: TYPE_OP type=kotlin.Float origin=IMPLICIT_CAST typeOperand=kotlin.Float + GET_VAR 'y: kotlin.Any declared in .testSmartCastToDifferentTypes' type=kotlin.Any origin=null then: CONST Int type=kotlin.Int value=0 BRANCH if: CONST Boolean type=kotlin.Boolean value=true @@ -139,7 +143,8 @@ FILE fqName: fileName:/whenByFloatingPoint.kt CONST Int type=kotlin.Int value=42 BRANCH if: CONST Boolean type=kotlin.Boolean value=true - then: GET_VAR 'x: kotlin.Any declared in .testWithPrematureExitInConditionSubexpression' type=kotlin.Double origin=null + then: TYPE_OP type=kotlin.Double origin=IMPLICIT_CAST typeOperand=kotlin.Double + GET_VAR 'x: kotlin.Any declared in .testWithPrematureExitInConditionSubexpression' type=kotlin.Any origin=null then: CONST Int type=kotlin.Int value=0 BRANCH if: CONST Boolean type=kotlin.Boolean value=true diff --git a/compiler/testData/ir/irText/expressions/funInterface/castFromAny.fir.txt b/compiler/testData/ir/irText/expressions/funInterface/castFromAny.fir.txt index cc65bb04717..51107b2a515 100644 --- a/compiler/testData/ir/irText/expressions/funInterface/castFromAny.fir.txt +++ b/compiler/testData/ir/irText/expressions/funInterface/castFromAny.fir.txt @@ -23,4 +23,5 @@ FILE fqName: fileName:/castFromAny.kt GET_VAR 'a: kotlin.Any? declared in .test' type=kotlin.Any? origin=null CALL 'public abstract fun invoke (): kotlin.Unit declared in .KRunnable' type=kotlin.Unit origin=null $this: CALL 'public final fun KRunnable (block: kotlin.Function0): .KRunnable declared in ' type=.KRunnable origin=null - block: GET_VAR 'a: kotlin.Any? declared in .test' type=kotlin.Function0 origin=null + block: TYPE_OP type=kotlin.Function0 origin=IMPLICIT_CAST typeOperand=kotlin.Function0 + GET_VAR 'a: kotlin.Any? declared in .test' type=kotlin.Any? origin=null diff --git a/compiler/testData/ir/irText/expressions/funInterface/samConversionsWithSmartCasts.fir.txt b/compiler/testData/ir/irText/expressions/funInterface/samConversionsWithSmartCasts.fir.txt index 24003b20dcc..d33fc8e011b 100644 --- a/compiler/testData/ir/irText/expressions/funInterface/samConversionsWithSmartCasts.fir.txt +++ b/compiler/testData/ir/irText/expressions/funInterface/samConversionsWithSmartCasts.fir.txt @@ -43,14 +43,16 @@ FILE fqName: fileName:/samConversionsWithSmartCasts.kt if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=.KRunnable GET_VAR 'a: kotlin.Function0 declared in .test1' type=kotlin.Function0 origin=null then: CALL 'public final fun run1 (r: .KRunnable): kotlin.Unit declared in ' type=kotlin.Unit origin=null - r: GET_VAR 'a: kotlin.Function0 declared in .test1' type=.KRunnable origin=null + r: TYPE_OP type=.KRunnable origin=IMPLICIT_CAST typeOperand=.KRunnable + GET_VAR 'a: kotlin.Function0 declared in .test1' type=kotlin.Function0 origin=null FUN name:test2 visibility:public modality:FINAL <> (a:.KRunnable) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:.KRunnable BLOCK_BODY TYPE_OP type=kotlin.Function0 origin=CAST typeOperand=kotlin.Function0 GET_VAR 'a: .KRunnable declared in .test2' type=.KRunnable origin=null CALL 'public final fun run1 (r: .KRunnable): kotlin.Unit declared in ' type=kotlin.Unit origin=null - r: GET_VAR 'a: .KRunnable declared in .test2' type=kotlin.Function0 origin=null + r: TYPE_OP type=kotlin.Function0 origin=IMPLICIT_CAST typeOperand=kotlin.Function0 + GET_VAR 'a: .KRunnable declared in .test2' type=.KRunnable origin=null FUN name:test3 visibility:public modality:FINAL <> (a:kotlin.Function0) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:kotlin.Function0 BLOCK_BODY @@ -59,8 +61,10 @@ FILE fqName: fileName:/samConversionsWithSmartCasts.kt if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=.KRunnable GET_VAR 'a: kotlin.Function0 declared in .test3' type=kotlin.Function0 origin=null then: CALL 'public final fun run2 (r1: .KRunnable, r2: .KRunnable): kotlin.Unit declared in ' type=kotlin.Unit origin=null - r1: GET_VAR 'a: kotlin.Function0 declared in .test3' type=.KRunnable origin=null - r2: GET_VAR 'a: kotlin.Function0 declared in .test3' type=.KRunnable origin=null + r1: TYPE_OP type=.KRunnable origin=IMPLICIT_CAST typeOperand=.KRunnable + GET_VAR 'a: kotlin.Function0 declared in .test3' type=kotlin.Function0 origin=null + r2: TYPE_OP type=.KRunnable origin=IMPLICIT_CAST typeOperand=.KRunnable + GET_VAR 'a: kotlin.Function0 declared in .test3' type=kotlin.Function0 origin=null FUN name:test4 visibility:public modality:FINAL <> (a:kotlin.Function0, b:kotlin.Function0) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:kotlin.Function0 VALUE_PARAMETER name:b index:1 type:kotlin.Function0 @@ -70,7 +74,8 @@ FILE fqName: fileName:/samConversionsWithSmartCasts.kt if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=.KRunnable GET_VAR 'a: kotlin.Function0 declared in .test4' type=kotlin.Function0 origin=null then: CALL 'public final fun run2 (r1: .KRunnable, r2: .KRunnable): kotlin.Unit declared in ' type=kotlin.Unit origin=null - r1: GET_VAR 'a: kotlin.Function0 declared in .test4' type=.KRunnable origin=null + r1: TYPE_OP type=.KRunnable origin=IMPLICIT_CAST typeOperand=.KRunnable + GET_VAR 'a: kotlin.Function0 declared in .test4' type=kotlin.Function0 origin=null r2: GET_VAR 'b: kotlin.Function0 declared in .test4' type=kotlin.Function0 origin=null FUN name:test5 visibility:public modality:FINAL <> (a:kotlin.Any) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:kotlin.Any @@ -80,7 +85,8 @@ FILE fqName: fileName:/samConversionsWithSmartCasts.kt if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=.KRunnable GET_VAR 'a: kotlin.Any declared in .test5' type=kotlin.Any origin=null then: CALL 'public final fun run1 (r: .KRunnable): kotlin.Unit declared in ' type=kotlin.Unit origin=null - r: GET_VAR 'a: kotlin.Any declared in .test5' type=.KRunnable origin=null + r: TYPE_OP type=.KRunnable origin=IMPLICIT_CAST typeOperand=.KRunnable + GET_VAR 'a: kotlin.Any declared in .test5' type=kotlin.Any origin=null FUN name:test5x visibility:public modality:FINAL <> (a:kotlin.Any) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:kotlin.Any BLOCK_BODY @@ -90,16 +96,19 @@ FILE fqName: fileName:/samConversionsWithSmartCasts.kt GET_VAR 'a: kotlin.Any declared in .test5x' type=kotlin.Any origin=null then: BLOCK type=kotlin.Unit origin=null TYPE_OP type=kotlin.Function0 origin=CAST typeOperand=kotlin.Function0 - GET_VAR 'a: kotlin.Any declared in .test5x' type=.KRunnable origin=null + TYPE_OP type=.KRunnable origin=IMPLICIT_CAST typeOperand=.KRunnable + GET_VAR 'a: kotlin.Any declared in .test5x' type=kotlin.Any origin=null CALL 'public final fun run1 (r: .KRunnable): kotlin.Unit declared in ' type=kotlin.Unit origin=null - r: GET_VAR 'a: kotlin.Any declared in .test5x' type=.KRunnable origin=null + r: TYPE_OP type=.KRunnable origin=IMPLICIT_CAST typeOperand=.KRunnable + GET_VAR 'a: kotlin.Any declared in .test5x' type=kotlin.Any origin=null FUN name:test6 visibility:public modality:FINAL <> (a:kotlin.Any) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:kotlin.Any BLOCK_BODY TYPE_OP type=kotlin.Function0 origin=CAST typeOperand=kotlin.Function0 GET_VAR 'a: kotlin.Any declared in .test6' type=kotlin.Any origin=null CALL 'public final fun run1 (r: .KRunnable): kotlin.Unit declared in ' type=kotlin.Unit origin=null - r: GET_VAR 'a: kotlin.Any declared in .test6' type=kotlin.Function0 origin=null + r: TYPE_OP type=kotlin.Function0 origin=IMPLICIT_CAST typeOperand=kotlin.Function0 + GET_VAR 'a: kotlin.Any declared in .test6' type=kotlin.Any origin=null FUN name:test8 visibility:public modality:FINAL <> (a:kotlin.Function0) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:kotlin.Function0 BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/implicitCastInReturnFromConstructor.fir.txt b/compiler/testData/ir/irText/expressions/implicitCastInReturnFromConstructor.fir.txt index 93ba6302f50..d600620512e 100644 --- a/compiler/testData/ir/irText/expressions/implicitCastInReturnFromConstructor.fir.txt +++ b/compiler/testData/ir/irText/expressions/implicitCastInReturnFromConstructor.fir.txt @@ -13,7 +13,8 @@ FILE fqName: fileName:/implicitCastInReturnFromConstructor.kt if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Unit GET_VAR 'x: kotlin.Any? declared in .C.' type=kotlin.Any? origin=null then: RETURN type=kotlin.Nothing from='public constructor (x: kotlin.Any?) declared in .C' - GET_VAR 'x: kotlin.Any? declared in .C.' type=kotlin.Unit origin=null + TYPE_OP type=kotlin.Unit origin=IMPLICIT_CAST typeOperand=kotlin.Unit + GET_VAR 'x: kotlin.Any? declared in .C.' type=kotlin.Any? origin=null DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in .C' FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] overridden: diff --git a/compiler/testData/ir/irText/expressions/implicitCastToNonNull.fir.txt b/compiler/testData/ir/irText/expressions/implicitCastToNonNull.fir.txt index bf1e0dd4106..311a605fdae 100644 --- a/compiler/testData/ir/irText/expressions/implicitCastToNonNull.fir.txt +++ b/compiler/testData/ir/irText/expressions/implicitCastToNonNull.fir.txt @@ -12,7 +12,8 @@ FILE fqName: fileName:/implicitCastToNonNull.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'public open fun (): kotlin.Int declared in kotlin.String' type=kotlin.Int origin=null - $this: GET_VAR 'x: kotlin.String? declared in .test1' type=kotlin.String origin=null + $this: TYPE_OP type=kotlin.String origin=IMPLICIT_CAST typeOperand=kotlin.String + GET_VAR 'x: kotlin.String? declared in .test1' type=kotlin.String? origin=null FUN name:test2 visibility:public modality:FINAL (x:T of .test2) returnType:kotlin.Int TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.CharSequence?] VALUE_PARAMETER name:x index:0 type:T of .test2 @@ -41,7 +42,8 @@ FILE fqName: fileName:/implicitCastToNonNull.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'public abstract fun (): kotlin.Int declared in kotlin.CharSequence' type=kotlin.Int origin=null - $this: GET_VAR 'x: kotlin.Any declared in .test3' type=T of .test3 origin=null + $this: TYPE_OP type=T of .test3 origin=IMPLICIT_CAST typeOperand=T of .test3 + GET_VAR 'x: kotlin.Any declared in .test3' type=kotlin.Any origin=null FUN name:test4 visibility:public modality:FINAL (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? @@ -55,7 +57,8 @@ FILE fqName: fileName:/implicitCastToNonNull.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'public abstract fun (): kotlin.Int declared in kotlin.CharSequence' type=kotlin.Int origin=null - $this: GET_VAR 'x: kotlin.Any? declared in .test4' type=T of .test4 origin=null + $this: TYPE_OP type=T of .test4 origin=IMPLICIT_CAST typeOperand=T of .test4 + GET_VAR 'x: kotlin.Any? declared in .test4' type=kotlin.Any? origin=null FUN name:test5 visibility:public modality:FINAL (x:T of .test5, fn:kotlin.Function1.test5, kotlin.Unit>) returnType:kotlin.Unit TYPE_PARAMETER name:T index:0 variance: superTypes:[S of .test5?] TYPE_PARAMETER name:S index:0 variance: superTypes:[kotlin.Any?] diff --git a/compiler/testData/ir/irText/expressions/implicitCastToTypeParameter.fir.txt b/compiler/testData/ir/irText/expressions/implicitCastToTypeParameter.fir.txt index 2d1aa733493..8215ecd43ab 100644 --- a/compiler/testData/ir/irText/expressions/implicitCastToTypeParameter.fir.txt +++ b/compiler/testData/ir/irText/expressions/implicitCastToTypeParameter.fir.txt @@ -56,7 +56,8 @@ FILE fqName: fileName:/implicitCastToTypeParameter.kt GET_VAR 'arg: kotlin.Any declared in .Bar.test' type=kotlin.Any origin=null CALL 'public final fun useT (t: T of .Bar): kotlin.Unit declared in .Bar' type=kotlin.Unit origin=null $this: GET_VAR ': .Bar declared in .Bar.test' type=.Bar origin=null - t: GET_VAR 'arg: kotlin.Any declared in .Bar.test' type=T of .Bar origin=null + t: TYPE_OP type=T of .Bar origin=IMPLICIT_CAST typeOperand=T of .Bar + GET_VAR 'arg: kotlin.Any declared in .Bar.test' type=kotlin.Any origin=null FUN name:useT visibility:public modality:FINAL <> ($this:.Bar, t:T of .Bar) returnType:kotlin.Unit $this: VALUE_PARAMETER name: type:.Bar VALUE_PARAMETER name:t index:0 type:T of .Bar diff --git a/compiler/testData/ir/irText/expressions/kt23030.fir.txt b/compiler/testData/ir/irText/expressions/kt23030.fir.txt index 75a31c44eca..54d6b4cfd37 100644 --- a/compiler/testData/ir/irText/expressions/kt23030.fir.txt +++ b/compiler/testData/ir/irText/expressions/kt23030.fir.txt @@ -48,8 +48,10 @@ FILE fqName: fileName:/kt23030.kt if: CONST Boolean type=kotlin.Boolean value=true then: CONST Boolean type=kotlin.Boolean value=false then: 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.Any declared in .testEqualsWithSmartCast' type=kotlin.Int origin=null - arg1: GET_VAR 'y: kotlin.Any declared in .testEqualsWithSmartCast' type=kotlin.Char origin=null + arg0: TYPE_OP type=kotlin.Int origin=IMPLICIT_CAST typeOperand=kotlin.Int + GET_VAR 'x: kotlin.Any declared in .testEqualsWithSmartCast' type=kotlin.Any origin=null + arg1: TYPE_OP type=kotlin.Char origin=IMPLICIT_CAST typeOperand=kotlin.Char + GET_VAR 'y: kotlin.Any declared in .testEqualsWithSmartCast' type=kotlin.Any origin=null BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST Boolean type=kotlin.Boolean value=false diff --git a/compiler/testData/ir/irText/expressions/sam/samConversionToGeneric.fir.txt b/compiler/testData/ir/irText/expressions/sam/samConversionToGeneric.fir.txt index 0d4e795a633..8612886ffff 100644 --- a/compiler/testData/ir/irText/expressions/sam/samConversionToGeneric.fir.txt +++ b/compiler/testData/ir/irText/expressions/sam/samConversionToGeneric.fir.txt @@ -36,7 +36,8 @@ FILE fqName: fileName:/samConversionToGeneric.kt GET_VAR 'a: kotlin.Any declared in .test4' type=kotlin.Any origin=null CALL 'public open fun bar (j: .J.H.bar?>?): kotlin.Unit [operator] declared in .H' type=kotlin.Unit origin=null : kotlin.String? - j: GET_VAR 'a: kotlin.Any declared in .test4' type=.J origin=null + j: TYPE_OP type=.J origin=IMPLICIT_CAST typeOperand=.J + GET_VAR 'a: kotlin.Any declared in .test4' type=kotlin.Any origin=null FUN name:test5 visibility:public modality:FINAL <> (a:kotlin.Any) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:kotlin.Any BLOCK_BODY @@ -44,7 +45,8 @@ FILE fqName: fileName:/samConversionToGeneric.kt GET_VAR 'a: kotlin.Any declared in .test5' type=kotlin.Any origin=null CALL 'public open fun bar (j: .J.H.bar?>?): kotlin.Unit [operator] declared in .H' type=kotlin.Unit origin=null : kotlin.String? - j: GET_VAR 'a: kotlin.Any declared in .test5' type=kotlin.Function1 origin=null + j: TYPE_OP type=kotlin.Function1 origin=IMPLICIT_CAST typeOperand=kotlin.Function1 + GET_VAR 'a: kotlin.Any declared in .test5' type=kotlin.Any origin=null FUN name:test6 visibility:public modality:FINAL (a:kotlin.Function1.test6, T of .test6>) returnType:kotlin.Unit TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] VALUE_PARAMETER name:a index:0 type:kotlin.Function1.test6, T of .test6> @@ -60,7 +62,8 @@ FILE fqName: fileName:/samConversionToGeneric.kt GET_VAR 'a: kotlin.Any declared in .test7' type=kotlin.Any origin=null CALL 'public open fun bar (j: .J.H.bar?>?): kotlin.Unit [operator] declared in .H' type=kotlin.Unit origin=null : T of .test7? - j: GET_VAR 'a: kotlin.Any declared in .test7' type=kotlin.Function1.test7, T of .test7> origin=null + j: TYPE_OP type=kotlin.Function1.test7, T of .test7> origin=IMPLICIT_CAST typeOperand=kotlin.Function1.test7, T of .test7> + GET_VAR 'a: kotlin.Any declared in .test7' type=kotlin.Any origin=null FUN name:test8 visibility:public modality:FINAL <> (efn:kotlin.Function1) returnType:.J VALUE_PARAMETER name:efn index:0 type:kotlin.Function1 BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/sam/samConversionsWithSmartCasts.fir.txt b/compiler/testData/ir/irText/expressions/sam/samConversionsWithSmartCasts.fir.txt index 6107d92d5df..430a3caf407 100644 --- a/compiler/testData/ir/irText/expressions/sam/samConversionsWithSmartCasts.fir.txt +++ b/compiler/testData/ir/irText/expressions/sam/samConversionsWithSmartCasts.fir.txt @@ -7,7 +7,8 @@ FILE fqName: fileName:/samConversionsWithSmartCasts.kt if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=java.lang.Runnable GET_VAR 'a: kotlin.Function0 declared in .test1' type=kotlin.Function0 origin=null then: CALL 'public open fun runStatic (r: java.lang.Runnable?): kotlin.Unit [operator] declared in .J' type=kotlin.Unit origin=null - r: GET_VAR 'a: kotlin.Function0 declared in .test1' type=java.lang.Runnable origin=null + r: TYPE_OP type=java.lang.Runnable origin=IMPLICIT_CAST typeOperand=java.lang.Runnable + GET_VAR 'a: kotlin.Function0 declared in .test1' type=kotlin.Function0 origin=null FUN name:test2 visibility:public modality:FINAL <> (a:kotlin.Function0) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:kotlin.Function0 BLOCK_BODY @@ -17,7 +18,8 @@ FILE fqName: fileName:/samConversionsWithSmartCasts.kt GET_VAR 'a: kotlin.Function0 declared in .test2' type=kotlin.Function0 origin=null then: CALL 'public open fun run1 (r: java.lang.Runnable?): kotlin.Unit [operator] declared in .J' type=kotlin.Unit origin=null $this: CONSTRUCTOR_CALL 'public constructor () [primary] declared in .J' type=.J origin=null - r: GET_VAR 'a: kotlin.Function0 declared in .test2' type=java.lang.Runnable origin=null + r: TYPE_OP type=java.lang.Runnable origin=IMPLICIT_CAST typeOperand=java.lang.Runnable + GET_VAR 'a: kotlin.Function0 declared in .test2' type=kotlin.Function0 origin=null FUN name:test3 visibility:public modality:FINAL <> (a:kotlin.Function0) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:kotlin.Function0 BLOCK_BODY @@ -27,8 +29,10 @@ FILE fqName: fileName:/samConversionsWithSmartCasts.kt GET_VAR 'a: kotlin.Function0 declared in .test3' type=kotlin.Function0 origin=null then: CALL 'public open fun run2 (r1: java.lang.Runnable?, r2: java.lang.Runnable?): kotlin.Unit [operator] declared in .J' type=kotlin.Unit origin=null $this: CONSTRUCTOR_CALL 'public constructor () [primary] declared in .J' type=.J origin=null - r1: GET_VAR 'a: kotlin.Function0 declared in .test3' type=java.lang.Runnable origin=null - r2: GET_VAR 'a: kotlin.Function0 declared in .test3' type=java.lang.Runnable origin=null + r1: TYPE_OP type=java.lang.Runnable origin=IMPLICIT_CAST typeOperand=java.lang.Runnable + GET_VAR 'a: kotlin.Function0 declared in .test3' type=kotlin.Function0 origin=null + r2: TYPE_OP type=java.lang.Runnable origin=IMPLICIT_CAST typeOperand=java.lang.Runnable + GET_VAR 'a: kotlin.Function0 declared in .test3' type=kotlin.Function0 origin=null FUN name:test4 visibility:public modality:FINAL <> (a:kotlin.Function0, b:kotlin.Function0) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:kotlin.Function0 VALUE_PARAMETER name:b index:1 type:kotlin.Function0 @@ -39,7 +43,8 @@ FILE fqName: fileName:/samConversionsWithSmartCasts.kt GET_VAR 'a: kotlin.Function0 declared in .test4' type=kotlin.Function0 origin=null then: CALL 'public open fun run2 (r1: java.lang.Runnable?, r2: java.lang.Runnable?): kotlin.Unit [operator] declared in .J' type=kotlin.Unit origin=null $this: CONSTRUCTOR_CALL 'public constructor () [primary] declared in .J' type=.J origin=null - r1: GET_VAR 'a: kotlin.Function0 declared in .test4' type=java.lang.Runnable origin=null + r1: TYPE_OP type=java.lang.Runnable origin=IMPLICIT_CAST typeOperand=java.lang.Runnable + GET_VAR 'a: kotlin.Function0 declared in .test4' type=kotlin.Function0 origin=null r2: GET_VAR 'b: kotlin.Function0 declared in .test4' type=kotlin.Function0 origin=null FUN name:test5 visibility:public modality:FINAL <> (a:kotlin.Any) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:kotlin.Any @@ -50,7 +55,8 @@ FILE fqName: fileName:/samConversionsWithSmartCasts.kt GET_VAR 'a: kotlin.Any declared in .test5' type=kotlin.Any origin=null then: CALL 'public open fun run1 (r: java.lang.Runnable?): kotlin.Unit [operator] declared in .J' type=kotlin.Unit origin=null $this: CONSTRUCTOR_CALL 'public constructor () [primary] declared in .J' type=.J origin=null - r: GET_VAR 'a: kotlin.Any declared in .test5' type=java.lang.Runnable origin=null + r: TYPE_OP type=java.lang.Runnable origin=IMPLICIT_CAST typeOperand=java.lang.Runnable + GET_VAR 'a: kotlin.Any declared in .test5' type=kotlin.Any origin=null FUN name:test5x visibility:public modality:FINAL <> (a:kotlin.Any) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:kotlin.Any BLOCK_BODY @@ -60,10 +66,12 @@ FILE fqName: fileName:/samConversionsWithSmartCasts.kt GET_VAR 'a: kotlin.Any declared in .test5x' type=kotlin.Any origin=null then: BLOCK type=kotlin.Unit origin=null TYPE_OP type=kotlin.Function0 origin=CAST typeOperand=kotlin.Function0 - GET_VAR 'a: kotlin.Any declared in .test5x' type=java.lang.Runnable origin=null + TYPE_OP type=java.lang.Runnable origin=IMPLICIT_CAST typeOperand=java.lang.Runnable + GET_VAR 'a: kotlin.Any declared in .test5x' type=kotlin.Any origin=null CALL 'public open fun run1 (r: java.lang.Runnable?): kotlin.Unit [operator] declared in .J' type=kotlin.Unit origin=null $this: CONSTRUCTOR_CALL 'public constructor () [primary] declared in .J' type=.J origin=null - r: GET_VAR 'a: kotlin.Any declared in .test5x' type=java.lang.Runnable origin=null + r: TYPE_OP type=java.lang.Runnable origin=IMPLICIT_CAST typeOperand=java.lang.Runnable + GET_VAR 'a: kotlin.Any declared in .test5x' type=kotlin.Any origin=null FUN name:test6 visibility:public modality:FINAL <> (a:kotlin.Any) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:kotlin.Any BLOCK_BODY @@ -71,7 +79,8 @@ FILE fqName: fileName:/samConversionsWithSmartCasts.kt GET_VAR 'a: kotlin.Any declared in .test6' type=kotlin.Any origin=null CALL 'public open fun run1 (r: java.lang.Runnable?): kotlin.Unit [operator] declared in .J' type=kotlin.Unit origin=null $this: CONSTRUCTOR_CALL 'public constructor () [primary] declared in .J' type=.J origin=null - r: GET_VAR 'a: kotlin.Any declared in .test6' type=kotlin.Function0 origin=null + r: TYPE_OP type=kotlin.Function0 origin=IMPLICIT_CAST typeOperand=kotlin.Function0 + GET_VAR 'a: kotlin.Any declared in .test6' type=kotlin.Any origin=null FUN name:test7 visibility:public modality:FINAL <> (a:kotlin.Function1) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:kotlin.Function1 BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/setFieldWithImplicitCast.fir.txt b/compiler/testData/ir/irText/expressions/setFieldWithImplicitCast.fir.txt index 712a8d66c72..b52816f7797 100644 --- a/compiler/testData/ir/irText/expressions/setFieldWithImplicitCast.fir.txt +++ b/compiler/testData/ir/irText/expressions/setFieldWithImplicitCast.fir.txt @@ -16,7 +16,8 @@ FILE fqName: fileName:/Derived.kt then: BLOCK type=kotlin.Unit origin=null SET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:value type:kotlin.String? visibility:public' type=kotlin.Unit origin=null receiver: GET_VAR ': .Derived declared in .Derived.setValue' type=.Derived origin=null - value: GET_VAR 'v: kotlin.Any declared in .Derived.setValue' type=kotlin.String origin=null + value: TYPE_OP type=kotlin.String origin=IMPLICIT_CAST typeOperand=kotlin.String + GET_VAR 'v: kotlin.Any declared in .Derived.setValue' 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 diff --git a/compiler/testData/ir/irText/expressions/smartCasts.fir.txt b/compiler/testData/ir/irText/expressions/smartCasts.fir.txt index d6166c8c12a..0d8d722169a 100644 --- a/compiler/testData/ir/irText/expressions/smartCasts.fir.txt +++ b/compiler/testData/ir/irText/expressions/smartCasts.fir.txt @@ -26,15 +26,19 @@ FILE fqName: fileName:/smartCasts.kt GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit CALL 'public final fun println (message: kotlin.Int): kotlin.Unit [inline] declared in kotlin.io' type=kotlin.Unit origin=null message: CALL 'public open fun (): kotlin.Int declared in kotlin.String' type=kotlin.Int origin=null - $this: GET_VAR 'x: kotlin.Any declared in .test1' type=kotlin.String origin=null + $this: TYPE_OP type=kotlin.String origin=IMPLICIT_CAST typeOperand=kotlin.String + GET_VAR 'x: kotlin.Any declared in .test1' type=kotlin.Any origin=null CALL 'public final fun expectsString (s: kotlin.String): kotlin.Unit declared in ' type=kotlin.Unit origin=null - s: GET_VAR 'x: kotlin.Any declared in .test1' type=kotlin.String origin=null + s: TYPE_OP type=kotlin.String origin=IMPLICIT_CAST typeOperand=kotlin.String + GET_VAR 'x: kotlin.Any declared in .test1' type=kotlin.Any origin=null CALL 'public final fun expectsInt (i: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=null i: CALL 'public open fun (): kotlin.Int declared in kotlin.String' type=kotlin.Int origin=null - $this: GET_VAR 'x: kotlin.Any declared in .test1' type=kotlin.String origin=null + $this: TYPE_OP type=kotlin.String origin=IMPLICIT_CAST typeOperand=kotlin.String + GET_VAR 'x: kotlin.Any declared in .test1' type=kotlin.Any origin=null CALL 'public final fun expectsString (s: kotlin.String): kotlin.Unit declared in ' type=kotlin.Unit origin=null s: CALL 'public final fun overloaded (s: kotlin.String): kotlin.String declared in ' type=kotlin.String origin=null - s: GET_VAR 'x: kotlin.Any declared in .test1' type=kotlin.String origin=null + s: TYPE_OP type=kotlin.String origin=IMPLICIT_CAST typeOperand=kotlin.String + GET_VAR 'x: kotlin.Any declared in .test1' type=kotlin.Any origin=null FUN name:test2 visibility:public modality:FINAL <> (x:kotlin.Any) returnType:kotlin.String VALUE_PARAMETER name:x index:0 type:kotlin.Any BLOCK_BODY @@ -46,7 +50,8 @@ FILE fqName: fileName:/smartCasts.kt CONST String type=kotlin.String value="" RETURN type=kotlin.Nothing from='public final fun test2 (x: kotlin.Any): kotlin.String declared in ' CALL 'public final fun overloaded (s: kotlin.String): kotlin.String declared in ' type=kotlin.String origin=null - s: GET_VAR 'x: kotlin.Any declared in .test2' type=kotlin.String origin=null + s: TYPE_OP type=kotlin.String origin=IMPLICIT_CAST typeOperand=kotlin.String + GET_VAR 'x: kotlin.Any declared in .test2' type=kotlin.Any origin=null FUN name:test3 visibility:public modality:FINAL <> (x:kotlin.Any) returnType:kotlin.String VALUE_PARAMETER name:x index:0 type:kotlin.Any BLOCK_BODY @@ -57,4 +62,5 @@ FILE fqName: fileName:/smartCasts.kt then: RETURN type=kotlin.Nothing from='public final fun test3 (x: kotlin.Any): kotlin.String declared in ' CONST String type=kotlin.String value="" RETURN type=kotlin.Nothing from='public final fun test3 (x: kotlin.Any): kotlin.String declared in ' - GET_VAR 'x: kotlin.Any declared in .test3' type=kotlin.String origin=null + TYPE_OP type=kotlin.String origin=IMPLICIT_CAST typeOperand=kotlin.String + GET_VAR 'x: kotlin.Any declared in .test3' type=kotlin.Any origin=null diff --git a/compiler/testData/ir/irText/expressions/smartCastsWithDestructuring.fir.txt b/compiler/testData/ir/irText/expressions/smartCastsWithDestructuring.fir.txt index 69468cde4b4..5776b9e0b2c 100644 --- a/compiler/testData/ir/irText/expressions/smartCastsWithDestructuring.fir.txt +++ b/compiler/testData/ir/irText/expressions/smartCastsWithDestructuring.fir.txt @@ -49,7 +49,8 @@ FILE fqName: fileName:/smartCastsWithDestructuring.kt then: RETURN type=kotlin.Nothing from='public final fun test (x: .I1): kotlin.Unit declared in ' GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:.I2 [val] - GET_VAR 'x: .I1 declared in .test' type=.I2 origin=null + TYPE_OP type=.I2 origin=IMPLICIT_CAST typeOperand=.I2 + GET_VAR 'x: .I1 declared in .test' type=.I1 origin=null VAR name:c1 type:kotlin.Int [val] CALL 'public final fun component1 (): kotlin.Int [operator] declared in ' type=kotlin.Int origin=null $receiver: GET_VAR 'val tmp_0: .I2 [val] declared in .test' type=.I2 origin=null diff --git a/compiler/testData/ir/irText/expressions/throw.fir.txt b/compiler/testData/ir/irText/expressions/throw.fir.txt index ff79ded8a7a..6a4041e0814 100644 --- a/compiler/testData/ir/irText/expressions/throw.fir.txt +++ b/compiler/testData/ir/irText/expressions/throw.fir.txt @@ -11,4 +11,5 @@ FILE fqName: fileName:/throw.kt if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Throwable GET_VAR 'a: kotlin.Any declared in .testImplicitCast' type=kotlin.Any origin=null then: THROW type=kotlin.Nothing - GET_VAR 'a: kotlin.Any declared in .testImplicitCast' type=kotlin.Throwable origin=null + TYPE_OP type=kotlin.Throwable origin=IMPLICIT_CAST typeOperand=kotlin.Throwable + GET_VAR 'a: kotlin.Any declared in .testImplicitCast' type=kotlin.Any origin=null diff --git a/compiler/testData/ir/irText/expressions/tryCatchWithImplicitCast.fir.txt b/compiler/testData/ir/irText/expressions/tryCatchWithImplicitCast.fir.txt index 9c2c32bbaed..045359c4e2b 100644 --- a/compiler/testData/ir/irText/expressions/tryCatchWithImplicitCast.fir.txt +++ b/compiler/testData/ir/irText/expressions/tryCatchWithImplicitCast.fir.txt @@ -10,7 +10,8 @@ FILE fqName: fileName:/tryCatchWithImplicitCast.kt GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit VAR name:t type:kotlin.String [val] TRY type=kotlin.String - try: GET_VAR 'a: kotlin.Any declared in .testImplicitCast' type=kotlin.String origin=null + try: TYPE_OP type=kotlin.String origin=IMPLICIT_CAST typeOperand=kotlin.String + GET_VAR 'a: kotlin.Any declared in .testImplicitCast' type=kotlin.Any origin=null CATCH parameter=val e: kotlin.Throwable [val] declared in .testImplicitCast VAR name:e type:kotlin.Throwable [val] CONST String type=kotlin.String value="" diff --git a/compiler/testData/ir/irText/expressions/typeArguments.fir.txt b/compiler/testData/ir/irText/expressions/typeArguments.fir.txt deleted file mode 100644 index 8d44222db4d..00000000000 --- a/compiler/testData/ir/irText/expressions/typeArguments.fir.txt +++ /dev/null @@ -1,15 +0,0 @@ -FILE fqName: fileName:/typeArguments.kt - FUN name:test1 visibility:public modality:FINAL <> (x:kotlin.Any) returnType:kotlin.Boolean - VALUE_PARAMETER name:x index:0 type:kotlin.Any - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test1 (x: kotlin.Any): kotlin.Boolean declared in ' - WHEN type=kotlin.Boolean origin=ANDAND - BRANCH - if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Array<*> - GET_VAR 'x: kotlin.Any declared in .test1' type=kotlin.Any origin=null - then: CALL 'public final fun isArrayOf (): kotlin.Boolean declared in kotlin.jvm' type=kotlin.Boolean origin=null - : kotlin.String - $receiver: GET_VAR 'x: kotlin.Any declared in .test1' type=kotlin.Array<*> origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST Boolean type=kotlin.Boolean value=false diff --git a/compiler/testData/ir/irText/expressions/typeArguments.kt b/compiler/testData/ir/irText/expressions/typeArguments.kt index d3729ec6044..e608a725efe 100644 --- a/compiler/testData/ir/irText/expressions/typeArguments.kt +++ b/compiler/testData/ir/irText/expressions/typeArguments.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // WITH_RUNTIME fun test1(x: Any) = diff --git a/compiler/testData/ir/irText/expressions/varargWithImplicitCast.fir.txt b/compiler/testData/ir/irText/expressions/varargWithImplicitCast.fir.txt index 3b93d65dfcb..9f1c0963612 100644 --- a/compiler/testData/ir/irText/expressions/varargWithImplicitCast.fir.txt +++ b/compiler/testData/ir/irText/expressions/varargWithImplicitCast.fir.txt @@ -10,7 +10,8 @@ FILE fqName: fileName:/varargWithImplicitCast.kt CALL 'public final fun intArrayOf (elements: kotlin.IntArray): kotlin.IntArray declared in kotlin' type=kotlin.IntArray origin=null RETURN type=kotlin.Nothing from='public final fun testScalar (a: kotlin.Any): kotlin.IntArray declared in ' CALL 'public final fun intArrayOf (elements: kotlin.IntArray): kotlin.IntArray declared in kotlin' type=kotlin.IntArray origin=null - elements: GET_VAR 'a: kotlin.Any declared in .testScalar' type=kotlin.Int origin=null + elements: TYPE_OP type=kotlin.Int origin=IMPLICIT_CAST typeOperand=kotlin.Int + GET_VAR 'a: kotlin.Any declared in .testScalar' type=kotlin.Any origin=null FUN name:testSpread visibility:public modality:FINAL <> (a:kotlin.Any) returnType:kotlin.IntArray VALUE_PARAMETER name:a index:0 type:kotlin.Any BLOCK_BODY @@ -22,4 +23,5 @@ FILE fqName: fileName:/varargWithImplicitCast.kt CALL 'public final fun intArrayOf (elements: kotlin.IntArray): kotlin.IntArray declared in kotlin' type=kotlin.IntArray origin=null RETURN type=kotlin.Nothing from='public final fun testSpread (a: kotlin.Any): kotlin.IntArray declared in ' CALL 'public final fun intArrayOf (elements: kotlin.IntArray): kotlin.IntArray declared in kotlin' type=kotlin.IntArray origin=null - elements: GET_VAR 'a: kotlin.Any declared in .testSpread' type=kotlin.IntArray origin=null + elements: TYPE_OP type=kotlin.IntArray origin=IMPLICIT_CAST typeOperand=kotlin.IntArray + GET_VAR 'a: kotlin.Any declared in .testSpread' type=kotlin.Any origin=null diff --git a/compiler/testData/ir/irText/expressions/when.fir.txt b/compiler/testData/ir/irText/expressions/when.fir.txt index 1e7b1a2e5c3..56b4630684b 100644 --- a/compiler/testData/ir/irText/expressions/when.fir.txt +++ b/compiler/testData/ir/irText/expressions/when.fir.txt @@ -66,23 +66,27 @@ FILE fqName: 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: GET_VAR 'x: kotlin.Any? declared in .test' type=kotlin.Any origin=null + arg0: TYPE_OP type=kotlin.Any origin=IMPLICIT_CAST typeOperand=kotlin.Any + GET_VAR 'x: kotlin.Any? declared in .test' type=kotlin.Any? origin=null arg1: GET_OBJECT 'CLASS OBJECT name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.A then: CONST String type=kotlin.String value="A" BRANCH if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.String - GET_VAR 'x: kotlin.Any? declared in .test' type=kotlin.Any origin=null + TYPE_OP type=kotlin.Any origin=IMPLICIT_CAST typeOperand=kotlin.Any + GET_VAR 'x: kotlin.Any? declared in .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 - GET_VAR 'x: kotlin.Any? declared in .test' type=kotlin.Any origin=null + TYPE_OP type=kotlin.Any origin=IMPLICIT_CAST typeOperand=kotlin.Any + GET_VAR 'x: kotlin.Any? declared in .test' type=kotlin.Any? origin=null then: CONST String type=kotlin.String value="!Number" BRANCH if: CALL 'public final fun contains (element: T of kotlin.collections.contains): kotlin.Boolean [operator] declared in kotlin.collections' type=kotlin.Boolean origin=null : kotlin.Number $receiver: CALL 'public final fun setOf (): kotlin.collections.Set [inline] declared in kotlin.collections' type=kotlin.collections.Set origin=null : kotlin.Nothing - element: GET_VAR 'x: kotlin.Any? declared in .test' type=kotlin.Number origin=null + element: TYPE_OP type=kotlin.Number origin=IMPLICIT_CAST typeOperand=kotlin.Number + GET_VAR 'x: kotlin.Any? declared in .test' type=kotlin.Any? origin=null then: CONST String type=kotlin.String value="nothingness?" BRANCH if: CONST Boolean type=kotlin.Boolean value=true diff --git a/compiler/testData/ir/irText/expressions/whenWithSubjectVariable.fir.txt b/compiler/testData/ir/irText/expressions/whenWithSubjectVariable.fir.txt index 8df16ea7445..bfd68c62d28 100644 --- a/compiler/testData/ir/irText/expressions/whenWithSubjectVariable.fir.txt +++ b/compiler/testData/ir/irText/expressions/whenWithSubjectVariable.fir.txt @@ -19,7 +19,8 @@ FILE fqName: fileName:/whenWithSubjectVariable.kt if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.String GET_VAR 'val y: kotlin.Any [val] declared in .test' type=kotlin.Any origin=null then: CALL 'public open fun (): kotlin.Int declared in kotlin.String' type=kotlin.Int origin=null - $this: GET_VAR 'val y: kotlin.Any [val] declared in .test' type=kotlin.String origin=null + $this: TYPE_OP type=kotlin.String origin=IMPLICIT_CAST typeOperand=kotlin.String + GET_VAR 'val y: kotlin.Any [val] declared in .test' type=kotlin.Any origin=null BRANCH if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=kotlin.Int GET_VAR 'val y: kotlin.Any [val] declared in .test' type=kotlin.Any origin=null diff --git a/compiler/testData/ir/irText/expressions/whileDoWhile.fir.txt b/compiler/testData/ir/irText/expressions/whileDoWhile.fir.txt index e990132d3a6..45060815f18 100644 --- a/compiler/testData/ir/irText/expressions/whileDoWhile.fir.txt +++ b/compiler/testData/ir/irText/expressions/whileDoWhile.fir.txt @@ -67,8 +67,10 @@ FILE fqName: fileName:/whileDoWhile.kt GET_VAR 'val a: kotlin.Any? [val] declared in .testSmartcastInCondition' type=kotlin.Any? origin=null then: BLOCK type=kotlin.Unit origin=null WHILE label=null origin=WHILE_LOOP - condition: GET_VAR 'val a: kotlin.Any? [val] declared in .testSmartcastInCondition' type=kotlin.Boolean origin=null + condition: TYPE_OP type=kotlin.Boolean origin=IMPLICIT_CAST typeOperand=kotlin.Boolean + GET_VAR 'val a: kotlin.Any? [val] declared in .testSmartcastInCondition' type=kotlin.Any? origin=null body: BLOCK type=kotlin.Unit origin=null DO_WHILE label=null origin=DO_WHILE_LOOP body: BLOCK type=kotlin.Unit origin=null - condition: GET_VAR 'val a: kotlin.Any? [val] declared in .testSmartcastInCondition' type=kotlin.Boolean origin=null + condition: TYPE_OP type=kotlin.Boolean origin=IMPLICIT_CAST typeOperand=kotlin.Boolean + GET_VAR 'val a: kotlin.Any? [val] declared in .testSmartcastInCondition' type=kotlin.Any? origin=null diff --git a/compiler/testData/ir/irText/types/smartCastOnFakeOverrideReceiver.fir.txt b/compiler/testData/ir/irText/types/smartCastOnFakeOverrideReceiver.fir.txt index 96ae9b8d90e..913e5b4b393 100644 --- a/compiler/testData/ir/irText/types/smartCastOnFakeOverrideReceiver.fir.txt +++ b/compiler/testData/ir/irText/types/smartCastOnFakeOverrideReceiver.fir.txt @@ -31,7 +31,8 @@ FILE fqName: fileName:/smartCastOnFakeOverrideReceiver.kt if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=.B GET_VAR 'x: kotlin.Any declared in .A.testA1' type=kotlin.Any origin=null then: CALL 'public final fun f (): kotlin.Int declared in .A' type=kotlin.Int origin=null - $this: GET_VAR 'x: kotlin.Any declared in .A.testA1' type=.B origin=null + $this: TYPE_OP type=.B origin=IMPLICIT_CAST typeOperand=.B + GET_VAR 'x: kotlin.Any declared in .A.testA1' type=kotlin.Any origin=null BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST Null type=kotlin.Nothing? value=null @@ -45,7 +46,8 @@ FILE fqName: fileName:/smartCastOnFakeOverrideReceiver.kt if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=.B GET_VAR 'x: kotlin.Any declared in .A.testA2' type=kotlin.Any origin=null then: CALL 'public final fun (): kotlin.Int declared in .A' type=kotlin.Int origin=null - $this: GET_VAR 'x: kotlin.Any declared in .A.testA2' type=.B origin=null + $this: TYPE_OP type=.B origin=IMPLICIT_CAST typeOperand=.B + GET_VAR 'x: kotlin.Any declared in .A.testA2' type=kotlin.Any origin=null BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST Null type=kotlin.Nothing? value=null @@ -78,7 +80,8 @@ FILE fqName: fileName:/smartCastOnFakeOverrideReceiver.kt if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=.B GET_VAR 'x: kotlin.Any declared in .B.testB1' type=kotlin.Any origin=null then: CALL 'public final fun f (): kotlin.Int declared in .A' type=kotlin.Int origin=null - $this: GET_VAR 'x: kotlin.Any declared in .B.testB1' type=.B origin=null + $this: TYPE_OP type=.B origin=IMPLICIT_CAST typeOperand=.B + GET_VAR 'x: kotlin.Any declared in .B.testB1' type=kotlin.Any origin=null BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST Null type=kotlin.Nothing? value=null @@ -92,7 +95,8 @@ FILE fqName: fileName:/smartCastOnFakeOverrideReceiver.kt if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=.B GET_VAR 'x: kotlin.Any declared in .B.testB2' type=kotlin.Any origin=null then: CALL 'public final fun (): kotlin.Int declared in .A' type=kotlin.Int origin=null - $this: GET_VAR 'x: kotlin.Any declared in .B.testB2' type=.B origin=null + $this: TYPE_OP type=.B origin=IMPLICIT_CAST typeOperand=.B + GET_VAR 'x: kotlin.Any declared in .B.testB2' type=kotlin.Any origin=null BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST Null type=kotlin.Nothing? value=null @@ -181,9 +185,11 @@ FILE fqName: fileName:/smartCastOnFakeOverrideReceiver.kt TYPE_OP type=.GB origin=CAST typeOperand=.GB GET_VAR 'a: kotlin.Any declared in .GB.testGB1' type=kotlin.Any origin=null CALL 'public final fun f (): kotlin.Int declared in .GA' type=kotlin.Int origin=null - $this: GET_VAR 'a: kotlin.Any declared in .GB.testGB1' type=.GB origin=null + $this: TYPE_OP type=.GB origin=IMPLICIT_CAST typeOperand=.GB + GET_VAR 'a: kotlin.Any declared in .GB.testGB1' type=kotlin.Any origin=null CALL 'public final fun (): kotlin.Int declared in .GA' type=kotlin.Int origin=null - $this: GET_VAR 'a: kotlin.Any declared in .GB.testGB1' type=.GB origin=null + $this: TYPE_OP type=.GB origin=IMPLICIT_CAST typeOperand=.GB + GET_VAR 'a: kotlin.Any declared in .GB.testGB1' type=kotlin.Any origin=null FUN FAKE_OVERRIDE name:f visibility:public modality:FINAL <> ($this:.GA) returnType:kotlin.Int [fake_override] overridden: public final fun f (): kotlin.Int declared in .GA diff --git a/compiler/testData/ir/irText/types/smartCastOnFieldReceiverOfGenericType.fir.txt b/compiler/testData/ir/irText/types/smartCastOnFieldReceiverOfGenericType.fir.txt index 50530520130..25c1027d2d3 100644 --- a/compiler/testData/ir/irText/types/smartCastOnFieldReceiverOfGenericType.fir.txt +++ b/compiler/testData/ir/irText/types/smartCastOnFieldReceiverOfGenericType.fir.txt @@ -8,8 +8,10 @@ FILE fqName: fileName:/smartCastOnFieldReceiverOfGenericType.kt TYPE_OP type=kotlin.String origin=CAST typeOperand=kotlin.String GET_VAR 'b: kotlin.Any declared in .testSetField' type=kotlin.Any origin=null SET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:value type:kotlin.String? visibility:public' type=kotlin.Unit origin=null - receiver: GET_VAR 'a: kotlin.Any declared in .testSetField' type=.JCell origin=null - value: GET_VAR 'b: kotlin.Any declared in .testSetField' type=kotlin.String origin=null + receiver: TYPE_OP type=.JCell origin=IMPLICIT_CAST typeOperand=.JCell + GET_VAR 'a: kotlin.Any declared in .testSetField' type=kotlin.Any origin=null + value: TYPE_OP type=kotlin.String origin=IMPLICIT_CAST typeOperand=kotlin.String + GET_VAR 'b: kotlin.Any declared in .testSetField' type=kotlin.Any origin=null FUN name:testGetField visibility:public modality:FINAL <> (a:kotlin.Any) returnType:kotlin.String VALUE_PARAMETER name:a index:0 type:kotlin.Any BLOCK_BODY @@ -17,4 +19,5 @@ FILE fqName: fileName:/smartCastOnFieldReceiverOfGenericType.kt GET_VAR 'a: kotlin.Any declared in .testGetField' type=kotlin.Any origin=null RETURN type=kotlin.Nothing from='public final fun testGetField (a: kotlin.Any): kotlin.String declared in ' GET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:value type:kotlin.String? visibility:public' type=kotlin.String? origin=GET_PROPERTY - receiver: GET_VAR 'a: kotlin.Any declared in .testGetField' type=.JCell origin=null + receiver: TYPE_OP type=.JCell origin=IMPLICIT_CAST typeOperand=.JCell + GET_VAR 'a: kotlin.Any declared in .testGetField' type=kotlin.Any origin=null diff --git a/compiler/testData/ir/irText/types/smartCastOnReceiverOfGenericType.fir.txt b/compiler/testData/ir/irText/types/smartCastOnReceiverOfGenericType.fir.txt index 35c03e51a3d..344f9293c62 100644 --- a/compiler/testData/ir/irText/types/smartCastOnReceiverOfGenericType.fir.txt +++ b/compiler/testData/ir/irText/types/smartCastOnReceiverOfGenericType.fir.txt @@ -8,8 +8,10 @@ FILE fqName: fileName:/smartCastOnReceiverOfGenericType.kt TYPE_OP type=kotlin.String origin=CAST typeOperand=kotlin.String GET_VAR 'b: kotlin.Any declared in .testFunction' type=kotlin.Any origin=null CALL 'public abstract fun add (element: kotlin.String): kotlin.Boolean declared in kotlin.collections.MutableList' type=kotlin.Boolean origin=null - $this: GET_VAR 'a: kotlin.Any declared in .testFunction' type=kotlin.collections.MutableList origin=null - element: GET_VAR 'b: kotlin.Any declared in .testFunction' type=kotlin.String origin=null + $this: TYPE_OP type=kotlin.collections.MutableList origin=IMPLICIT_CAST typeOperand=kotlin.collections.MutableList + GET_VAR 'a: kotlin.Any declared in .testFunction' type=kotlin.Any origin=null + element: TYPE_OP type=kotlin.String origin=IMPLICIT_CAST typeOperand=kotlin.String + GET_VAR 'b: kotlin.Any declared in .testFunction' type=kotlin.Any origin=null FUN name:testProperty visibility:public modality:FINAL <> (a:kotlin.Any, b:kotlin.Any) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:kotlin.Any VALUE_PARAMETER name:b index:1 type:kotlin.Any @@ -43,8 +45,10 @@ FILE fqName: fileName:/smartCastOnReceiverOfGenericType.kt TYPE_OP type=kotlin.collections.List.testNonSubstitutedTypeParameter> origin=CAST typeOperand=kotlin.collections.List.testNonSubstitutedTypeParameter> GET_VAR 'b: kotlin.Any declared in .testNonSubstitutedTypeParameter' type=kotlin.Any origin=null CALL 'public abstract fun add (element: kotlin.collections.List.testNonSubstitutedTypeParameter>): kotlin.Boolean declared in kotlin.collections.MutableList' type=kotlin.Boolean origin=null - $this: GET_VAR 'a: kotlin.Any declared in .testNonSubstitutedTypeParameter' type=kotlin.collections.MutableList.testNonSubstitutedTypeParameter>> origin=null - element: GET_VAR 'b: kotlin.Any declared in .testNonSubstitutedTypeParameter' type=kotlin.collections.List.testNonSubstitutedTypeParameter> origin=null + $this: TYPE_OP type=kotlin.collections.MutableList.testNonSubstitutedTypeParameter>> origin=IMPLICIT_CAST typeOperand=kotlin.collections.MutableList.testNonSubstitutedTypeParameter>> + GET_VAR 'a: kotlin.Any declared in .testNonSubstitutedTypeParameter' type=kotlin.Any origin=null + element: TYPE_OP type=kotlin.collections.List.testNonSubstitutedTypeParameter> origin=IMPLICIT_CAST typeOperand=kotlin.collections.List.testNonSubstitutedTypeParameter> + GET_VAR 'b: kotlin.Any declared in .testNonSubstitutedTypeParameter' type=kotlin.Any origin=null CLASS CLASS name:Cell modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Cell TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?]