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 00f5867758a..f9fd0012214 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 @@ -42,6 +42,7 @@ import org.jetbrains.kotlin.ir.expressions.* import org.jetbrains.kotlin.ir.expressions.impl.* import org.jetbrains.kotlin.ir.symbols.IrClassSymbol import org.jetbrains.kotlin.ir.types.* +import org.jetbrains.kotlin.ir.util.coerceToUnitIfNeeded import org.jetbrains.kotlin.ir.util.constructors import org.jetbrains.kotlin.ir.util.defaultType import org.jetbrains.kotlin.ir.util.parentClassOrNull @@ -590,7 +591,7 @@ class Fir2IrVisitor( } else { emptyList() } - ) + ).insertImplicitCasts() } } @@ -608,16 +609,44 @@ class Fir2IrVisitor( IrCompositeImpl( startOffset, endOffset, type, origin, mapToIrStatements().filterNotNull() - ) + ).insertImplicitCasts() } else { IrBlockImpl( startOffset, endOffset, type, origin, mapToIrStatements().filterNotNull() - ) + ).insertImplicitCasts() } } } + private fun IrBlockBody.insertImplicitCasts(): IrBlockBody { + if (statements.isEmpty()) return this + + statements.forEachIndexed { i, irStatement -> + if (irStatement !is IrErrorCallExpression && irStatement is IrExpression) { + statements[i] = irStatement.coerceToUnitIfNeeded(irStatement.type, irBuiltIns) + } + } + return this + } + + private fun IrContainerExpression.insertImplicitCasts(): IrContainerExpression { + if (statements.isEmpty()) return this + + val lastIndex = statements.lastIndex + statements.forEachIndexed { i, irStatement -> + if (irStatement !is IrErrorCallExpression && irStatement is IrExpression) { + if (i != lastIndex) { + statements[i] = irStatement.coerceToUnitIfNeeded(irStatement.type, irBuiltIns) + } else { + // TODO: for the last statement, need to cast to the return type if mismatched + } + } + } + + return this + } + override fun visitErrorExpression(errorExpression: FirErrorExpression, data: Any?): IrElement { return errorExpression.convertWithOffsets { startOffset, endOffset -> IrErrorExpressionImpl( diff --git a/compiler/testData/codegen/box/polymorphicSignature/nullArgument.kt b/compiler/testData/codegen/box/polymorphicSignature/nullArgument.kt index 82dd0c4c1d3..60848ffcdab 100644 --- a/compiler/testData/codegen/box/polymorphicSignature/nullArgument.kt +++ b/compiler/testData/codegen/box/polymorphicSignature/nullArgument.kt @@ -1,6 +1,5 @@ // !LANGUAGE: +PolymorphicSignature // TARGET_BACKEND: JVM -// IGNORE_BACKEND_FIR: JVM_IR // FULL_JDK // SKIP_JDK6 // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/polymorphicSignature/voidReturnType.kt b/compiler/testData/codegen/box/polymorphicSignature/voidReturnType.kt index 14dede93d78..9033f481118 100644 --- a/compiler/testData/codegen/box/polymorphicSignature/voidReturnType.kt +++ b/compiler/testData/codegen/box/polymorphicSignature/voidReturnType.kt @@ -1,6 +1,5 @@ // !LANGUAGE: +PolymorphicSignature // TARGET_BACKEND: JVM -// IGNORE_BACKEND_FIR: JVM_IR // FULL_JDK // SKIP_JDK6 // WITH_RUNTIME diff --git a/compiler/testData/ir/irText/declarations/localDelegatedProperties.fir.txt b/compiler/testData/ir/irText/declarations/localDelegatedProperties.fir.txt index 3799cf02ee5..e5aea5de02d 100644 --- a/compiler/testData/ir/irText/declarations/localDelegatedProperties.fir.txt +++ b/compiler/testData/ir/irText/declarations/localDelegatedProperties.fir.txt @@ -15,7 +15,8 @@ FILE fqName: fileName:/localDelegatedProperties.kt SET_VAR 'var x: kotlin.Int? [var] declared in .test2' type=kotlin.Unit origin=EQ 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 - GET_VAR 'val tmp_0: kotlin.Int [val] declared in .test2' type=kotlin.Int origin=null + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + GET_VAR 'val tmp_0: kotlin.Int [val] declared in .test2' type=kotlin.Int origin=null SET_VAR 'var x: kotlin.Int? [var] declared in .test2' type=kotlin.Unit origin=EQ CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null $this: TYPE_OP type=kotlin.Int origin=IMPLICIT_CAST typeOperand=kotlin.Int diff --git a/compiler/testData/ir/irText/declarations/parameters/useNextParamInLambda.fir.txt b/compiler/testData/ir/irText/declarations/parameters/useNextParamInLambda.fir.txt index f1ee547fa73..82f49aa4f1a 100644 --- a/compiler/testData/ir/irText/declarations/parameters/useNextParamInLambda.fir.txt +++ b/compiler/testData/ir/irText/declarations/parameters/useNextParamInLambda.fir.txt @@ -22,13 +22,14 @@ FILE fqName: fileName:/useNextParamInLambda.kt BLOCK_BODY VAR name:result type:kotlin.String [var] CONST String type=kotlin.String value="fail" - TRY type=kotlin.Any - try: CALL 'public final fun f (f1: kotlin.Function0, f2: kotlin.Function0): kotlin.String declared in ' type=kotlin.String origin=null - CATCH parameter=val e: java.lang.Exception [val] declared in .box - VAR name:e type:java.lang.Exception [val] - BLOCK type=kotlin.Unit origin=null - SET_VAR 'var result: kotlin.String [var] declared in .box' type=kotlin.Unit origin=EQ - CONST String type=kotlin.String value="OK" + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + TRY type=kotlin.Any + try: CALL 'public final fun f (f1: kotlin.Function0, f2: kotlin.Function0): kotlin.String declared in ' type=kotlin.String origin=null + CATCH parameter=val e: java.lang.Exception [val] declared in .box + VAR name:e type:java.lang.Exception [val] + BLOCK type=kotlin.Unit origin=null + SET_VAR 'var result: kotlin.String [var] declared in .box' type=kotlin.Unit origin=EQ + CONST String type=kotlin.String value="OK" RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' CALL 'public final fun plus (other: kotlin.Any?): kotlin.String [operator] declared in kotlin.String' type=kotlin.String origin=PLUS $this: CALL 'public final fun f (f1: kotlin.Function0, f2: kotlin.Function0): kotlin.String declared in ' type=kotlin.String origin=null diff --git a/compiler/testData/ir/irText/expressions/arrayAugmentedAssignment1.fir.txt b/compiler/testData/ir/irText/expressions/arrayAugmentedAssignment1.fir.txt index 6921edada75..5844f003d83 100644 --- a/compiler/testData/ir/irText/expressions/arrayAugmentedAssignment1.fir.txt +++ b/compiler/testData/ir/irText/expressions/arrayAugmentedAssignment1.fir.txt @@ -88,4 +88,5 @@ FILE fqName: fileName:/arrayAugmentedAssignment1.kt index: CONST Int type=kotlin.Int value=0 value: CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null $this: GET_VAR 'val tmp_4: kotlin.Int [val] declared in .testMember' type=kotlin.Int origin=null - GET_VAR 'val tmp_4: kotlin.Int [val] declared in .testMember' type=kotlin.Int origin=null + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + GET_VAR 'val tmp_4: kotlin.Int [val] declared in .testMember' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/expressions/booleanConstsInAndAndOrOr.fir.txt b/compiler/testData/ir/irText/expressions/booleanConstsInAndAndOrOr.fir.txt deleted file mode 100644 index 3d8810084cc..00000000000 --- a/compiler/testData/ir/irText/expressions/booleanConstsInAndAndOrOr.fir.txt +++ /dev/null @@ -1,23 +0,0 @@ -FILE fqName: fileName:/booleanConstsInAndAndOrOr.kt - FUN name:test1 visibility:public modality:FINAL <> (b:kotlin.Boolean) returnType:kotlin.Unit - VALUE_PARAMETER name:b index:0 type:kotlin.Boolean - BLOCK_BODY - WHEN type=kotlin.Boolean origin=ANDAND - BRANCH - if: GET_VAR 'b: kotlin.Boolean declared in .test1' type=kotlin.Boolean origin=null - then: RETURN type=kotlin.Nothing from='public final fun test1 (b: kotlin.Boolean): kotlin.Unit declared in ' - GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST Boolean type=kotlin.Boolean value=false - FUN name:test2 visibility:public modality:FINAL <> (b:kotlin.Boolean) returnType:kotlin.Unit - VALUE_PARAMETER name:b index:0 type:kotlin.Boolean - BLOCK_BODY - WHEN type=kotlin.Boolean origin=OROR - BRANCH - if: GET_VAR 'b: kotlin.Boolean declared in .test2' type=kotlin.Boolean origin=null - then: CONST Boolean type=kotlin.Boolean value=true - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: RETURN type=kotlin.Nothing from='public final fun test2 (b: kotlin.Boolean): kotlin.Unit declared in ' - GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit diff --git a/compiler/testData/ir/irText/expressions/booleanConstsInAndAndOrOr.kt b/compiler/testData/ir/irText/expressions/booleanConstsInAndAndOrOr.kt index 93fb1cc9a36..cd708c77cea 100644 --- a/compiler/testData/ir/irText/expressions/booleanConstsInAndAndOrOr.kt +++ b/compiler/testData/ir/irText/expressions/booleanConstsInAndAndOrOr.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL fun test1(b: Boolean) { b && return } diff --git a/compiler/testData/ir/irText/expressions/breakContinueInLoopHeader.fir.txt b/compiler/testData/ir/irText/expressions/breakContinueInLoopHeader.fir.txt index fd69896cc20..719ae858383 100644 --- a/compiler/testData/ir/irText/expressions/breakContinueInLoopHeader.fir.txt +++ b/compiler/testData/ir/irText/expressions/breakContinueInLoopHeader.fir.txt @@ -111,7 +111,8 @@ FILE fqName: fileName:/breakContinueInLoopHeader.kt SET_VAR 'var i: kotlin.Int [var] declared in .test5' type=kotlin.Unit origin=EQ CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null $this: GET_VAR 'val tmp_6: kotlin.Int [val] declared in .test5' type=kotlin.Int origin=null - GET_VAR 'var i: kotlin.Int [var] declared in .test5' type=kotlin.Int origin=null + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + GET_VAR 'var i: kotlin.Int [var] declared in .test5' type=kotlin.Int origin=null VAR name:j type:kotlin.Int [var] CONST Int type=kotlin.Int value=0 DO_WHILE label=Inner origin=DO_WHILE_LOOP diff --git a/compiler/testData/ir/irText/expressions/breakContinueInWhen.fir.txt b/compiler/testData/ir/irText/expressions/breakContinueInWhen.fir.txt index b1202b2b173..98d4f3320de 100644 --- a/compiler/testData/ir/irText/expressions/breakContinueInWhen.fir.txt +++ b/compiler/testData/ir/irText/expressions/breakContinueInWhen.fir.txt @@ -114,7 +114,8 @@ FILE fqName: fileName:/breakContinueInWhen.kt SET_VAR 'var k: kotlin.Int [var] declared in .testContinueDoWhile' type=kotlin.Unit origin=EQ CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null $this: GET_VAR 'val tmp_2: kotlin.Int [val] declared in .testContinueDoWhile' type=kotlin.Int origin=null - GET_VAR 'var k: kotlin.Int [var] declared in .testContinueDoWhile' type=kotlin.Int origin=null + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + GET_VAR 'var k: kotlin.Int [var] declared in .testContinueDoWhile' type=kotlin.Int origin=null WHEN type=kotlin.Unit origin=WHEN BRANCH if: CALL 'public final fun greater (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=GT diff --git a/compiler/testData/ir/irText/expressions/callableReferences/caoWithAdaptationForSam.fir.txt b/compiler/testData/ir/irText/expressions/callableReferences/caoWithAdaptationForSam.fir.txt index fc801840aa4..012bc43aff6 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/caoWithAdaptationForSam.fir.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/caoWithAdaptationForSam.fir.txt @@ -170,8 +170,9 @@ FILE fqName: fileName:/caoWithAdaptationForSam.kt FUN name:test5 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.Function1 origin=CAST typeOperand=kotlin.Function1 - GET_VAR 'a: kotlin.Any declared in .test5' type=kotlin.Any origin=null + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + TYPE_OP type=kotlin.Function1 origin=CAST typeOperand=kotlin.Function1 + GET_VAR 'a: kotlin.Any declared in .test5' type=kotlin.Any origin=null BLOCK type=kotlin.Unit origin=null VAR IR_TEMPORARY_VARIABLE name:tmp_8 type:.A [val] GET_OBJECT 'CLASS OBJECT name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.A @@ -191,11 +192,13 @@ FILE fqName: fileName:/caoWithAdaptationForSam.kt 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.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 - TYPE_OP type=kotlin.Function1 origin=IMPLICIT_CAST typeOperand=kotlin.Function1 + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + 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=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + TYPE_OP type=.IFoo origin=CAST typeOperand=.IFoo + TYPE_OP type=kotlin.Function1 origin=IMPLICIT_CAST typeOperand=kotlin.Function1 + GET_VAR 'a: kotlin.Any declared in .test6' type=kotlin.Any origin=null BLOCK type=kotlin.Unit origin=null VAR IR_TEMPORARY_VARIABLE name:tmp_10 type:.A [val] GET_OBJECT 'CLASS OBJECT name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.A diff --git a/compiler/testData/ir/irText/expressions/classReference.fir.txt b/compiler/testData/ir/irText/expressions/classReference.fir.txt index e8bf61b1571..247322d87b1 100644 --- a/compiler/testData/ir/irText/expressions/classReference.fir.txt +++ b/compiler/testData/ir/irText/expressions/classReference.fir.txt @@ -20,13 +20,17 @@ FILE fqName: fileName:/classReference.kt $this: VALUE_PARAMETER name: type:kotlin.Any FUN name:test visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY - CLASS_REFERENCE 'CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.reflect.KClass<.A> - GET_CLASS type=kotlin.reflect.KClass<.A> - CONSTRUCTOR_CALL 'public constructor () [primary] declared in .A' type=.A origin=null - CALL 'public final fun (): java.lang.Class> declared in kotlin.jvm' type=java.lang.Class<.A> origin=GET_PROPERTY - : .A - $receiver: CLASS_REFERENCE 'CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.reflect.KClass<.A> - CALL 'public final fun (): java.lang.Class> declared in kotlin.jvm' type=java.lang.Class<.A> origin=GET_PROPERTY - : .A - $receiver: GET_CLASS type=kotlin.reflect.KClass<.A> + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + CLASS_REFERENCE 'CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.reflect.KClass<.A> + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + GET_CLASS type=kotlin.reflect.KClass<.A> CONSTRUCTOR_CALL 'public constructor () [primary] declared in .A' type=.A origin=null + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + CALL 'public final fun (): java.lang.Class> declared in kotlin.jvm' type=java.lang.Class<.A> origin=GET_PROPERTY + : .A + $receiver: CLASS_REFERENCE 'CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.reflect.KClass<.A> + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + CALL 'public final fun (): java.lang.Class> declared in kotlin.jvm' type=java.lang.Class<.A> origin=GET_PROPERTY + : .A + $receiver: GET_CLASS type=kotlin.reflect.KClass<.A> + CONSTRUCTOR_CALL 'public constructor () [primary] declared in .A' type=.A origin=null diff --git a/compiler/testData/ir/irText/expressions/coercionToUnit.fir.txt b/compiler/testData/ir/irText/expressions/coercionToUnit.fir.txt index e4baa82bd7c..89ac7828f47 100644 --- a/compiler/testData/ir/irText/expressions/coercionToUnit.fir.txt +++ b/compiler/testData/ir/irText/expressions/coercionToUnit.fir.txt @@ -15,36 +15,39 @@ FILE fqName: fileName:/coercionToUnit.kt FUN name:test2 visibility:public modality:FINAL <> (mc:kotlin.collections.MutableCollection) returnType:kotlin.Unit VALUE_PARAMETER name:mc index:0 type:kotlin.collections.MutableCollection BLOCK_BODY - CALL 'public abstract fun add (element: E of kotlin.collections.MutableCollection): kotlin.Boolean declared in kotlin.collections.MutableCollection' type=kotlin.Boolean origin=null - $this: GET_VAR 'mc: kotlin.collections.MutableCollection declared in .test2' type=kotlin.collections.MutableCollection origin=null - element: CONST String type=kotlin.String value="" + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + CALL 'public abstract fun add (element: E of kotlin.collections.MutableCollection): kotlin.Boolean declared in kotlin.collections.MutableCollection' type=kotlin.Boolean origin=null + $this: GET_VAR 'mc: kotlin.collections.MutableCollection declared in .test2' type=kotlin.collections.MutableCollection origin=null + element: CONST String type=kotlin.String value="" FUN name:test3 visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY - BLOCK type=kotlin.Unit? origin=SAFE_CALL - VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:java.io.PrintStream? [val] - GET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:out type:java.io.PrintStream? visibility:public [final,static]' type=java.io.PrintStream? origin=GET_PROPERTY - WHEN type=kotlin.Unit? origin=null - BRANCH - if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp_0: java.io.PrintStream? [val] declared in .test3' type=java.io.PrintStream? origin=null - arg1: CONST Null type=kotlin.Nothing? value=null - then: CONST Null type=kotlin.Nothing? value=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CALL 'public open fun println (p0: kotlin.String?): kotlin.Unit declared in java.io.PrintStream' type=kotlin.Unit origin=null - $this: GET_VAR 'val tmp_0: java.io.PrintStream? [val] declared in .test3' type=java.io.PrintStream? origin=null - p0: CONST String type=kotlin.String value="Hello," - BLOCK type=kotlin.Unit? origin=SAFE_CALL - VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:java.io.PrintStream? [val] - GET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:out type:java.io.PrintStream? visibility:public [final,static]' type=java.io.PrintStream? origin=GET_PROPERTY - WHEN type=kotlin.Unit? origin=null - BRANCH - if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp_1: java.io.PrintStream? [val] declared in .test3' type=java.io.PrintStream? origin=null - arg1: CONST Null type=kotlin.Nothing? value=null - then: CONST Null type=kotlin.Nothing? value=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CALL 'public open fun println (p0: kotlin.String?): kotlin.Unit declared in java.io.PrintStream' type=kotlin.Unit origin=null - $this: GET_VAR 'val tmp_1: java.io.PrintStream? [val] declared in .test3' type=java.io.PrintStream? origin=null - p0: CONST String type=kotlin.String value="world!" + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + BLOCK type=kotlin.Unit? origin=SAFE_CALL + VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:java.io.PrintStream? [val] + GET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:out type:java.io.PrintStream? visibility:public [final,static]' type=java.io.PrintStream? origin=GET_PROPERTY + WHEN type=kotlin.Unit? origin=null + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'val tmp_0: java.io.PrintStream? [val] declared in .test3' type=java.io.PrintStream? origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: CONST Null type=kotlin.Nothing? value=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CALL 'public open fun println (p0: kotlin.String?): kotlin.Unit declared in java.io.PrintStream' type=kotlin.Unit origin=null + $this: GET_VAR 'val tmp_0: java.io.PrintStream? [val] declared in .test3' type=java.io.PrintStream? origin=null + p0: CONST String type=kotlin.String value="Hello," + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + BLOCK type=kotlin.Unit? origin=SAFE_CALL + VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:java.io.PrintStream? [val] + GET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:out type:java.io.PrintStream? visibility:public [final,static]' type=java.io.PrintStream? origin=GET_PROPERTY + WHEN type=kotlin.Unit? origin=null + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'val tmp_1: java.io.PrintStream? [val] declared in .test3' type=java.io.PrintStream? origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: CONST Null type=kotlin.Nothing? value=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CALL 'public open fun println (p0: kotlin.String?): kotlin.Unit declared in java.io.PrintStream' type=kotlin.Unit origin=null + $this: GET_VAR 'val tmp_1: java.io.PrintStream? [val] declared in .test3' type=java.io.PrintStream? origin=null + p0: CONST String type=kotlin.String value="world!" diff --git a/compiler/testData/ir/irText/expressions/complexAugmentedAssignment.fir.txt b/compiler/testData/ir/irText/expressions/complexAugmentedAssignment.fir.txt index eca8b7ab977..88cd4498583 100644 --- a/compiler/testData/ir/irText/expressions/complexAugmentedAssignment.fir.txt +++ b/compiler/testData/ir/irText/expressions/complexAugmentedAssignment.fir.txt @@ -139,7 +139,8 @@ FILE fqName: fileName:/complexAugmentedAssignment.kt GET_VAR 'val tmp_2: kotlin.Int [val] declared in .test1' type=kotlin.Int origin=null value: 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 .test1' type=kotlin.Int origin=null - GET_VAR 'val tmp_0: kotlin.Int [val] declared in .test1' type=kotlin.Int origin=null + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + GET_VAR 'val tmp_0: kotlin.Int [val] declared in .test1' type=kotlin.Int origin=null FUN name:test2 visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:kotlin.Int [val] @@ -149,7 +150,8 @@ FILE fqName: fileName:/complexAugmentedAssignment.kt $this: GET_OBJECT 'CLASS OBJECT name:X1 modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.X1 : CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null $this: GET_VAR 'val tmp_3: kotlin.Int [val] declared in .test2' type=kotlin.Int origin=null - GET_VAR 'val tmp_3: kotlin.Int [val] declared in .test2' type=kotlin.Int origin=null + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + GET_VAR 'val tmp_3: kotlin.Int [val] declared in .test2' type=kotlin.Int origin=null VAR IR_TEMPORARY_VARIABLE name:tmp_4 type:kotlin.Int [val] CALL 'public final fun (): kotlin.Int declared in .X1.X2' type=kotlin.Int origin=GET_PROPERTY $this: GET_OBJECT 'CLASS OBJECT name:X2 modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.X1.X2 @@ -157,7 +159,8 @@ FILE fqName: fileName:/complexAugmentedAssignment.kt $this: GET_OBJECT 'CLASS OBJECT name:X2 modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.X1.X2 : CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null $this: GET_VAR 'val tmp_4: kotlin.Int [val] declared in .test2' type=kotlin.Int origin=null - GET_VAR 'val tmp_4: kotlin.Int [val] declared in .test2' type=kotlin.Int origin=null + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + GET_VAR 'val tmp_4: kotlin.Int [val] declared in .test2' type=kotlin.Int origin=null VAR IR_TEMPORARY_VARIABLE name:tmp_5 type:kotlin.Int [val] CALL 'public final fun (): kotlin.Int declared in .X1.X2.X3' type=kotlin.Int origin=GET_PROPERTY $this: GET_OBJECT 'CLASS OBJECT name:X3 modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.X1.X2.X3 @@ -165,7 +168,8 @@ FILE fqName: fileName:/complexAugmentedAssignment.kt $this: GET_OBJECT 'CLASS OBJECT name:X3 modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.X1.X2.X3 : CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null $this: GET_VAR 'val tmp_5: kotlin.Int [val] declared in .test2' type=kotlin.Int origin=null - GET_VAR 'val tmp_5: kotlin.Int [val] declared in .test2' type=kotlin.Int origin=null + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + GET_VAR 'val tmp_5: kotlin.Int [val] declared in .test2' type=kotlin.Int origin=null CLASS CLASS name:B modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.B CONSTRUCTOR visibility:public <> (s:kotlin.Int) returnType:.B [primary] diff --git a/compiler/testData/ir/irText/expressions/funInterface/castFromAny.fir.txt b/compiler/testData/ir/irText/expressions/funInterface/castFromAny.fir.txt deleted file mode 100644 index a95d76ae11a..00000000000 --- a/compiler/testData/ir/irText/expressions/funInterface/castFromAny.fir.txt +++ /dev/null @@ -1,27 +0,0 @@ -FILE fqName: fileName:/castFromAny.kt - CLASS INTERFACE name:KRunnable modality:ABSTRACT visibility:public [fun] superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.KRunnable - FUN name:invoke visibility:public modality:ABSTRACT <> ($this:.KRunnable) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.KRunnable - 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 - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:test 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 .test' type=kotlin.Any? origin=null - CALL 'public abstract fun invoke (): kotlin.Unit declared in .KRunnable' type=kotlin.Unit origin=null - $this: TYPE_OP type=.KRunnable origin=SAM_CONVERSION typeOperand=.KRunnable - 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/castFromAny.kt b/compiler/testData/ir/irText/expressions/funInterface/castFromAny.kt index 9581e8ee90f..10e88207378 100644 --- a/compiler/testData/ir/irText/expressions/funInterface/castFromAny.kt +++ b/compiler/testData/ir/irText/expressions/funInterface/castFromAny.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +NewInference +FunctionalInterfaceConversion +SamConversionPerArgument +SamConversionForKotlinFunctions fun interface KRunnable { diff --git a/compiler/testData/ir/irText/expressions/funInterface/partialSam.fir.txt b/compiler/testData/ir/irText/expressions/funInterface/partialSam.fir.txt index 178e359f178..44f04c877e6 100644 --- a/compiler/testData/ir/irText/expressions/funInterface/partialSam.fir.txt +++ b/compiler/testData/ir/irText/expressions/funInterface/partialSam.fir.txt @@ -136,27 +136,29 @@ FILE fqName: fileName:/partialSam.kt FUN name:test visibility:public modality:FINAL <> (j:.J) returnType:kotlin.Unit VALUE_PARAMETER name:j index:0 type:.J BLOCK_BODY - CALL 'public final fun runConversion (f1: .Fn, f2: .Fn): kotlin.Int declared in .J' type=kotlin.Int origin=null - $this: GET_VAR 'j: .J declared in .test' type=.J origin=null - f1: CALL 'public final fun (): .fsi. declared in ' type=.fsi. origin=GET_PROPERTY - f2: TYPE_OP type=.Fn origin=SAM_CONVERSION typeOperand=.Fn - FUN_EXPR type=kotlin.Function3 origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (s:kotlin.String, i:kotlin.Int, ti:kotlin.Int) returnType:kotlin.String - VALUE_PARAMETER name:s index:0 type:kotlin.String - VALUE_PARAMETER name:i index:1 type:kotlin.Int - VALUE_PARAMETER name:ti index:2 type:kotlin.Int - BLOCK_BODY - RETURN type=kotlin.Nothing from='local final fun (s: kotlin.String, i: kotlin.Int, ti: kotlin.Int): kotlin.String declared in .test' - CONST String type=kotlin.String value="" - CALL 'public final fun runConversion (f1: .Fn, f2: .Fn): kotlin.Int declared in .J' type=kotlin.Int origin=null - $this: GET_VAR 'j: .J declared in .test' type=.J origin=null - f1: TYPE_OP type=.Fn origin=SAM_CONVERSION typeOperand=.Fn - FUN_EXPR type=kotlin.Function3 origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (s:kotlin.String, i:kotlin.Int, ts:kotlin.String) returnType:kotlin.Int - VALUE_PARAMETER name:s index:0 type:kotlin.String - VALUE_PARAMETER name:i index:1 type:kotlin.Int - VALUE_PARAMETER name:ts index:2 type:kotlin.String - BLOCK_BODY - RETURN type=kotlin.Nothing from='local final fun (s: kotlin.String, i: kotlin.Int, ts: kotlin.String): kotlin.Int declared in .test' - CONST Int type=kotlin.Int value=1 - f2: CALL 'public final fun (): .fis. declared in ' type=.fis. origin=GET_PROPERTY + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + CALL 'public final fun runConversion (f1: .Fn, f2: .Fn): kotlin.Int declared in .J' type=kotlin.Int origin=null + $this: GET_VAR 'j: .J declared in .test' type=.J origin=null + f1: CALL 'public final fun (): .fsi. declared in ' type=.fsi. origin=GET_PROPERTY + f2: TYPE_OP type=.Fn origin=SAM_CONVERSION typeOperand=.Fn + FUN_EXPR type=kotlin.Function3 origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (s:kotlin.String, i:kotlin.Int, ti:kotlin.Int) returnType:kotlin.String + VALUE_PARAMETER name:s index:0 type:kotlin.String + VALUE_PARAMETER name:i index:1 type:kotlin.Int + VALUE_PARAMETER name:ti index:2 type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun (s: kotlin.String, i: kotlin.Int, ti: kotlin.Int): kotlin.String declared in .test' + CONST String type=kotlin.String value="" + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + CALL 'public final fun runConversion (f1: .Fn, f2: .Fn): kotlin.Int declared in .J' type=kotlin.Int origin=null + $this: GET_VAR 'j: .J declared in .test' type=.J origin=null + f1: TYPE_OP type=.Fn origin=SAM_CONVERSION typeOperand=.Fn + FUN_EXPR type=kotlin.Function3 origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (s:kotlin.String, i:kotlin.Int, ts:kotlin.String) returnType:kotlin.Int + VALUE_PARAMETER name:s index:0 type:kotlin.String + VALUE_PARAMETER name:i index:1 type:kotlin.Int + VALUE_PARAMETER name:ts index:2 type:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun (s: kotlin.String, i: kotlin.Int, ts: kotlin.String): kotlin.Int declared in .test' + CONST Int type=kotlin.Int value=1 + f2: CALL 'public final fun (): .fis. declared in ' type=.fis. origin=GET_PROPERTY diff --git a/compiler/testData/ir/irText/expressions/funInterface/samConversionsWithSmartCasts.fir.txt b/compiler/testData/ir/irText/expressions/funInterface/samConversionsWithSmartCasts.fir.txt index 2e97ae159d3..86e5d5b4cdb 100644 --- a/compiler/testData/ir/irText/expressions/funInterface/samConversionsWithSmartCasts.fir.txt +++ b/compiler/testData/ir/irText/expressions/funInterface/samConversionsWithSmartCasts.fir.txt @@ -48,8 +48,9 @@ FILE fqName: fileName:/samConversionsWithSmartCasts.kt 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 + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + 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: TYPE_OP type=kotlin.Function0 origin=IMPLICIT_CAST typeOperand=kotlin.Function0 GET_VAR 'a: .KRunnable declared in .test2' type=.KRunnable origin=null @@ -96,17 +97,19 @@ FILE fqName: fileName:/samConversionsWithSmartCasts.kt if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=.KRunnable 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 - TYPE_OP type=.KRunnable origin=IMPLICIT_CAST typeOperand=.KRunnable - GET_VAR 'a: kotlin.Any declared in .test5x' type=kotlin.Any origin=null + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + TYPE_OP type=kotlin.Function0 origin=CAST typeOperand=kotlin.Function0 + 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: 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 + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + 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: TYPE_OP type=.KRunnable origin=SAM_CONVERSION typeOperand=.KRunnable TYPE_OP type=kotlin.Function0 origin=IMPLICIT_CAST typeOperand=kotlin.Function0 diff --git a/compiler/testData/ir/irText/expressions/ifElseIf.fir.txt b/compiler/testData/ir/irText/expressions/ifElseIf.fir.txt index 33ebe2a4ea1..edac1a38f99 100644 --- a/compiler/testData/ir/irText/expressions/ifElseIf.fir.txt +++ b/compiler/testData/ir/irText/expressions/ifElseIf.fir.txt @@ -23,13 +23,14 @@ FILE fqName: fileName:/ifElseIf.kt FUN name:testEmptyBranches1 visibility:public modality:FINAL <> (flag:kotlin.Boolean) returnType:kotlin.Unit VALUE_PARAMETER name:flag index:0 type:kotlin.Boolean BLOCK_BODY - WHEN type=kotlin.Any origin=IF - BRANCH - if: GET_VAR 'flag: kotlin.Boolean declared in .testEmptyBranches1' type=kotlin.Boolean origin=null - then: BLOCK type=kotlin.Unit origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST Boolean type=kotlin.Boolean value=true + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + WHEN type=kotlin.Any origin=IF + BRANCH + if: GET_VAR 'flag: kotlin.Boolean declared in .testEmptyBranches1' type=kotlin.Boolean origin=null + then: BLOCK type=kotlin.Unit origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=true WHEN type=kotlin.Unit origin=IF BRANCH if: GET_VAR 'flag: kotlin.Boolean declared in .testEmptyBranches1' type=kotlin.Boolean origin=null @@ -37,13 +38,14 @@ FILE fqName: fileName:/ifElseIf.kt FUN name:testEmptyBranches2 visibility:public modality:FINAL <> (flag:kotlin.Boolean) returnType:kotlin.Unit VALUE_PARAMETER name:flag index:0 type:kotlin.Boolean BLOCK_BODY - WHEN type=kotlin.Any origin=IF - BRANCH - if: GET_VAR 'flag: kotlin.Boolean declared in .testEmptyBranches2' type=kotlin.Boolean origin=null - then: BLOCK type=kotlin.Unit origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST Boolean type=kotlin.Boolean value=true + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + WHEN type=kotlin.Any origin=IF + BRANCH + if: GET_VAR 'flag: kotlin.Boolean declared in .testEmptyBranches2' type=kotlin.Boolean origin=null + then: BLOCK type=kotlin.Unit origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=true WHEN type=kotlin.Unit origin=IF BRANCH if: GET_VAR 'flag: kotlin.Boolean declared in .testEmptyBranches2' type=kotlin.Boolean origin=null @@ -51,10 +53,11 @@ FILE fqName: fileName:/ifElseIf.kt FUN name:testEmptyBranches3 visibility:public modality:FINAL <> (flag:kotlin.Boolean) returnType:kotlin.Unit VALUE_PARAMETER name:flag index:0 type:kotlin.Boolean BLOCK_BODY - WHEN type=kotlin.Any origin=IF - BRANCH - if: GET_VAR 'flag: kotlin.Boolean declared in .testEmptyBranches3' type=kotlin.Boolean origin=null - then: BLOCK type=kotlin.Unit origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST Boolean type=kotlin.Boolean value=true + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + WHEN type=kotlin.Any origin=IF + BRANCH + if: GET_VAR 'flag: kotlin.Boolean declared in .testEmptyBranches3' type=kotlin.Boolean origin=null + then: BLOCK type=kotlin.Unit origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=true diff --git a/compiler/testData/ir/irText/expressions/implicitCastToTypeParameter.fir.txt b/compiler/testData/ir/irText/expressions/implicitCastToTypeParameter.fir.txt index 0fff177080b..ff627c5d41f 100644 --- a/compiler/testData/ir/irText/expressions/implicitCastToTypeParameter.fir.txt +++ b/compiler/testData/ir/irText/expressions/implicitCastToTypeParameter.fir.txt @@ -55,8 +55,9 @@ FILE fqName: fileName:/implicitCastToTypeParameter.kt $this: VALUE_PARAMETER name: type:.Bar.Bar> VALUE_PARAMETER name:arg index:0 type:kotlin.Any BLOCK_BODY - TYPE_OP type=T of .Bar origin=CAST typeOperand=T of .Bar - GET_VAR 'arg: kotlin.Any declared in .Bar.test' type=kotlin.Any origin=null + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + TYPE_OP type=T of .Bar origin=CAST typeOperand=T of .Bar + 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.Bar> declared in .Bar.test' type=.Bar.Bar> origin=null t: TYPE_OP type=T of .Bar origin=IMPLICIT_CAST typeOperand=T of .Bar diff --git a/compiler/testData/ir/irText/expressions/javaSyntheticGenericPropertyAccess.fir.txt b/compiler/testData/ir/irText/expressions/javaSyntheticGenericPropertyAccess.fir.txt index 1329db49282..cb9db9ab879 100644 --- a/compiler/testData/ir/irText/expressions/javaSyntheticGenericPropertyAccess.fir.txt +++ b/compiler/testData/ir/irText/expressions/javaSyntheticGenericPropertyAccess.fir.txt @@ -3,8 +3,9 @@ FILE fqName: fileName:/javaSyntheticGenericPropertyAccess.kt TYPE_PARAMETER name:F index:0 variance: superTypes:[kotlin.Any?] VALUE_PARAMETER name:j index:0 type:.J.test> BLOCK_BODY - CALL 'public open fun getFoo (): kotlin.Int declared in .J' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR 'j: .J.test> declared in .test' type=.J.test> origin=null + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + CALL 'public open fun getFoo (): kotlin.Int declared in .J' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR 'j: .J.test> declared in .test' type=.J.test> origin=null CALL 'public open fun setFoo (x: kotlin.Int): kotlin.Unit declared in .J' type=kotlin.Unit origin=EQ $this: GET_VAR 'j: .J.test> declared in .test' type=.J.test> origin=null x: CONST Int type=kotlin.Int value=1 @@ -15,7 +16,8 @@ FILE fqName: fileName:/javaSyntheticGenericPropertyAccess.kt $this: GET_VAR 'j: .J.test> declared in .test' type=.J.test> origin=null x: 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 .test' type=kotlin.Int origin=null - GET_VAR 'val tmp_0: kotlin.Int [val] declared in .test' type=kotlin.Int origin=null + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + GET_VAR 'val tmp_0: kotlin.Int [val] declared in .test' type=kotlin.Int origin=null CALL 'public open fun setFoo (x: kotlin.Int): kotlin.Unit declared in .J' type=kotlin.Unit origin=EQ $this: GET_VAR 'j: .J.test> declared in .test' type=.J.test> origin=null x: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/expressions/javaSyntheticPropertyAccess.fir.txt b/compiler/testData/ir/irText/expressions/javaSyntheticPropertyAccess.fir.txt index 9f9196e3d52..c74ce0c9409 100644 --- a/compiler/testData/ir/irText/expressions/javaSyntheticPropertyAccess.fir.txt +++ b/compiler/testData/ir/irText/expressions/javaSyntheticPropertyAccess.fir.txt @@ -2,8 +2,9 @@ FILE fqName: fileName:/javaSyntheticPropertyAccess.kt FUN name:test visibility:public modality:FINAL <> (j:.J) returnType:kotlin.Unit VALUE_PARAMETER name:j index:0 type:.J BLOCK_BODY - CALL 'public open fun getFoo (): kotlin.Int declared in .J' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR 'j: .J declared in .test' type=.J origin=null + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + CALL 'public open fun getFoo (): kotlin.Int declared in .J' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR 'j: .J declared in .test' type=.J origin=null CALL 'public open fun setFoo (x: kotlin.Int): kotlin.Unit declared in .J' type=kotlin.Unit origin=EQ $this: GET_VAR 'j: .J declared in .test' type=.J origin=null x: CONST Int type=kotlin.Int value=1 @@ -14,7 +15,8 @@ FILE fqName: fileName:/javaSyntheticPropertyAccess.kt $this: GET_VAR 'j: .J declared in .test' type=.J origin=null x: 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 .test' type=kotlin.Int origin=null - GET_VAR 'val tmp_0: kotlin.Int [val] declared in .test' type=kotlin.Int origin=null + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + GET_VAR 'val tmp_0: kotlin.Int [val] declared in .test' type=kotlin.Int origin=null CALL 'public open fun setFoo (x: kotlin.Int): kotlin.Unit declared in .J' type=kotlin.Unit origin=EQ $this: GET_VAR 'j: .J declared in .test' type=.J origin=null x: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/expressions/jvmFieldWithIntersectionTypes.fir.txt b/compiler/testData/ir/irText/expressions/jvmFieldWithIntersectionTypes.fir.txt index a1698368bd8..3a5abfe7978 100644 --- a/compiler/testData/ir/irText/expressions/jvmFieldWithIntersectionTypes.fir.txt +++ b/compiler/testData/ir/irText/expressions/jvmFieldWithIntersectionTypes.fir.txt @@ -127,8 +127,9 @@ FILE fqName: fileName:/jvmFieldWithIntersectionTypes.kt SET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:f type:kotlin.Int visibility:public' type=kotlin.Unit origin=EQ receiver: GET_VAR 'val k: .JFieldOwner [val] declared in .test' type=.JFieldOwner origin=null value: CONST Int type=kotlin.Int value=42 - GET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:f type:kotlin.Int visibility:public' type=kotlin.Int origin=GET_PROPERTY - receiver: GET_VAR 'val k: .JFieldOwner [val] declared in .test' type=.JFieldOwner origin=null + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + GET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:f type:kotlin.Int visibility:public' type=kotlin.Int origin=GET_PROPERTY + receiver: GET_VAR 'val k: .JFieldOwner [val] declared in .test' type=.JFieldOwner origin=null VAR name:md1 type:.DerivedThroughMid1 [val] CONSTRUCTOR_CALL 'public constructor () [primary] declared in .DerivedThroughMid1' type=.DerivedThroughMid1 origin=null VAR name:md2 type:.DerivedThroughMid2 [val] @@ -144,5 +145,6 @@ FILE fqName: fileName:/jvmFieldWithIntersectionTypes.kt SET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:f type:kotlin.Int visibility:public' type=kotlin.Unit origin=EQ receiver: GET_VAR 'val mk: .Mid [val] declared in .test' type=.Mid origin=null value: CONST Int type=kotlin.Int value=44 - GET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:f type:kotlin.Int visibility:public' type=kotlin.Int origin=GET_PROPERTY - receiver: GET_VAR 'val mk: .Mid [val] declared in .test' type=.Mid origin=null + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + GET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:f type:kotlin.Int visibility:public' type=kotlin.Int origin=GET_PROPERTY + receiver: GET_VAR 'val mk: .Mid [val] declared in .test' type=.Mid origin=null diff --git a/compiler/testData/ir/irText/expressions/kt37570.fir.txt b/compiler/testData/ir/irText/expressions/kt37570.fir.txt index 26cd213af61..16424ad49d3 100644 --- a/compiler/testData/ir/irText/expressions/kt37570.fir.txt +++ b/compiler/testData/ir/irText/expressions/kt37570.fir.txt @@ -20,16 +20,17 @@ FILE fqName: fileName:/kt37570.kt receiver: GET_VAR ': .A declared in .A.' type=.A origin=null ANONYMOUS_INITIALIZER isStatic=false BLOCK_BODY - CALL 'public final fun apply (block: @[ExtensionFunctionType] kotlin.Function1): T of kotlin.apply [inline] declared in kotlin' type=kotlin.String origin=null - : kotlin.String - $receiver: CALL 'public final fun a (): kotlin.String declared in ' type=kotlin.String origin=null - block: FUN_EXPR type=kotlin.Function1 origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:kotlin.String) returnType:kotlin.Unit - $receiver: VALUE_PARAMETER name: type:kotlin.String - BLOCK_BODY - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:b type:kotlin.String visibility:private [final]' type=kotlin.Unit origin=null - receiver: GET_VAR ': .A declared in .A' type=.A origin=null - value: GET_VAR ': kotlin.String declared in .A.' type=kotlin.String origin=null + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + CALL 'public final fun apply (block: @[ExtensionFunctionType] kotlin.Function1): T of kotlin.apply [inline] declared in kotlin' type=kotlin.String origin=null + : kotlin.String + $receiver: CALL 'public final fun a (): kotlin.String declared in ' type=kotlin.String origin=null + block: FUN_EXPR type=kotlin.Function1 origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:kotlin.String) returnType:kotlin.Unit + $receiver: VALUE_PARAMETER name: type:kotlin.String + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:b type:kotlin.String visibility:private [final]' type=kotlin.Unit origin=null + receiver: GET_VAR ': .A declared in .A' type=.A origin=null + value: GET_VAR ': kotlin.String declared in .A.' type=kotlin.String 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/lambdaInCAO.fir.txt b/compiler/testData/ir/irText/expressions/lambdaInCAO.fir.txt index a385b271c3a..d8a59aca01d 100644 --- a/compiler/testData/ir/irText/expressions/lambdaInCAO.fir.txt +++ b/compiler/testData/ir/irText/expressions/lambdaInCAO.fir.txt @@ -48,4 +48,5 @@ FILE fqName: fileName:/lambdaInCAO.kt GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit value: 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 .test3' type=kotlin.Int origin=null - GET_VAR 'val tmp_0: kotlin.Int [val] declared in .test3' type=kotlin.Int origin=null + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + GET_VAR 'val tmp_0: kotlin.Int [val] declared in .test3' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/expressions/objectClassReference.fir.txt b/compiler/testData/ir/irText/expressions/objectClassReference.fir.txt deleted file mode 100644 index 224f9cdd1dd..00000000000 --- a/compiler/testData/ir/irText/expressions/objectClassReference.fir.txt +++ /dev/null @@ -1,26 +0,0 @@ -FILE fqName: fileName:/objectClassReference.kt - CLASS OBJECT name:A modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A - CONSTRUCTOR visibility:private <> () returnType:.A [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' - 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 - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:test visibility:public modality:FINAL <> () returnType:kotlin.Unit - BLOCK_BODY - CLASS_REFERENCE 'CLASS OBJECT name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.reflect.KClass<.A> - CALL 'public final fun (): java.lang.Class> declared in kotlin.jvm' type=java.lang.Class<.A> origin=GET_PROPERTY - : .A - $receiver: CLASS_REFERENCE 'CLASS OBJECT name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.reflect.KClass<.A> diff --git a/compiler/testData/ir/irText/expressions/objectClassReference.kt b/compiler/testData/ir/irText/expressions/objectClassReference.kt index c0d3efd9519..18948ffacbc 100644 --- a/compiler/testData/ir/irText/expressions/objectClassReference.kt +++ b/compiler/testData/ir/irText/expressions/objectClassReference.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL //WITH_RUNTIME object A diff --git a/compiler/testData/ir/irText/expressions/safeAssignment.fir.txt b/compiler/testData/ir/irText/expressions/safeAssignment.fir.txt index 483a951297d..4491357a6c7 100644 --- a/compiler/testData/ir/irText/expressions/safeAssignment.fir.txt +++ b/compiler/testData/ir/irText/expressions/safeAssignment.fir.txt @@ -41,17 +41,18 @@ FILE fqName: fileName:/safeAssignment.kt FUN name:test visibility:public modality:FINAL <> (nc:.C?) returnType:kotlin.Unit VALUE_PARAMETER name:nc index:0 type:.C? BLOCK_BODY - BLOCK type=kotlin.Unit? origin=SAFE_CALL - VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:.C? [val] - GET_VAR 'nc: .C? declared in .test' type=.C? origin=null - WHEN type=kotlin.Unit? origin=null - BRANCH - if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp_0: .C? [val] declared in .test' type=.C? origin=null - arg1: CONST Null type=kotlin.Nothing? value=null - then: CONST Null type=kotlin.Nothing? value=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .C' type=kotlin.Unit origin=EQ - $this: GET_VAR 'val tmp_0: .C? [val] declared in .test' type=.C? origin=null - : CONST Int type=kotlin.Int value=42 + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + BLOCK type=kotlin.Unit? origin=SAFE_CALL + VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:.C? [val] + GET_VAR 'nc: .C? declared in .test' type=.C? origin=null + WHEN type=kotlin.Unit? origin=null + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'val tmp_0: .C? [val] declared in .test' type=.C? origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: CONST Null type=kotlin.Nothing? value=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .C' type=kotlin.Unit origin=EQ + $this: GET_VAR 'val tmp_0: .C? [val] declared in .test' type=.C? origin=null + : CONST Int type=kotlin.Int value=42 diff --git a/compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.fir.txt b/compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.fir.txt index e4638bc4f2f..004669d3b28 100644 --- a/compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.fir.txt +++ b/compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.fir.txt @@ -75,22 +75,24 @@ FILE fqName:test fileName:/safeCallWithIncrementDecrement.kt if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'public final fun (): kotlin.Int declared in test' type=kotlin.Int origin=GET_PROPERTY $receiver: GET_VAR 'val tmp_2: test.C? [val] declared in test.testProperty' type=test.C? origin=null - BLOCK type=kotlin.Unit? origin=SAFE_CALL - VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:test.C? [val] - GET_VAR 'nc: test.C? declared in test.testProperty' type=test.C? origin=null - WHEN type=kotlin.Unit? origin=null - BRANCH - if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp_3: test.C? [val] declared in test.testProperty' type=test.C? origin=null - arg1: CONST Null type=kotlin.Nothing? value=null - then: CONST Null type=kotlin.Nothing? value=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CALL 'public final fun (value: kotlin.Int): kotlin.Unit declared in test' type=kotlin.Unit origin=EQ - $receiver: GET_VAR 'val tmp_3: test.C? [val] declared in test.testProperty' type=test.C? origin=null - value: CALL 'public final fun inc (): kotlin.Int? [operator] declared in test' type=kotlin.Int? origin=null - $receiver: GET_VAR 'val tmp_1: kotlin.Int? [val] declared in test.testProperty' type=kotlin.Int? origin=null - GET_VAR 'val tmp_1: kotlin.Int? [val] declared in test.testProperty' type=kotlin.Int? origin=null + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + BLOCK type=kotlin.Unit? origin=SAFE_CALL + VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:test.C? [val] + GET_VAR 'nc: test.C? declared in test.testProperty' type=test.C? origin=null + WHEN type=kotlin.Unit? origin=null + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'val tmp_3: test.C? [val] declared in test.testProperty' type=test.C? origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: CONST Null type=kotlin.Nothing? value=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CALL 'public final fun (value: kotlin.Int): kotlin.Unit declared in test' type=kotlin.Unit origin=EQ + $receiver: GET_VAR 'val tmp_3: test.C? [val] declared in test.testProperty' type=test.C? origin=null + value: CALL 'public final fun inc (): kotlin.Int? [operator] declared in test' type=kotlin.Int? origin=null + $receiver: GET_VAR 'val tmp_1: kotlin.Int? [val] declared in test.testProperty' type=kotlin.Int? origin=null + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + GET_VAR 'val tmp_1: kotlin.Int? [val] declared in test.testProperty' type=kotlin.Int? origin=null FUN name:testArrayAccess visibility:public modality:FINAL <> (nc:test.C?) returnType:kotlin.Unit VALUE_PARAMETER name:nc index:0 type:test.C? BLOCK_BODY @@ -127,4 +129,5 @@ FILE fqName:test fileName:/safeCallWithIncrementDecrement.kt index: CONST Int type=kotlin.Int value=0 value: CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null $this: GET_VAR 'val tmp_4: kotlin.Int [val] declared in test.testArrayAccess' type=kotlin.Int origin=null - GET_VAR 'val tmp_4: kotlin.Int [val] declared in test.testArrayAccess' type=kotlin.Int origin=null + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + GET_VAR 'val tmp_4: kotlin.Int [val] declared in test.testArrayAccess' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/expressions/safeCalls.fir.txt b/compiler/testData/ir/irText/expressions/safeCalls.fir.txt index 7723450c19a..d4cf6e937d1 100644 --- a/compiler/testData/ir/irText/expressions/safeCalls.fir.txt +++ b/compiler/testData/ir/irText/expressions/safeCalls.fir.txt @@ -116,20 +116,21 @@ FILE fqName: fileName:/safeCalls.kt FUN name:test4 visibility:public modality:FINAL <> (x:.Ref?) returnType:kotlin.Unit VALUE_PARAMETER name:x index:0 type:.Ref? BLOCK_BODY - BLOCK type=kotlin.Unit? origin=SAFE_CALL - VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:.Ref? [val] - GET_VAR 'x: .Ref? declared in .test4' type=.Ref? origin=null - WHEN type=kotlin.Unit? origin=null - BRANCH - if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp_3: .Ref? [val] declared in .test4' type=.Ref? origin=null - arg1: CONST Null type=kotlin.Nothing? value=null - then: CONST Null type=kotlin.Nothing? value=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .Ref' type=kotlin.Unit origin=EQ - $this: GET_VAR 'val tmp_3: .Ref? [val] declared in .test4' type=.Ref? origin=null - : CONST Int type=kotlin.Int value=0 + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + BLOCK type=kotlin.Unit? origin=SAFE_CALL + VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:.Ref? [val] + GET_VAR 'x: .Ref? declared in .test4' type=.Ref? origin=null + WHEN type=kotlin.Unit? origin=null + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'val tmp_3: .Ref? [val] declared in .test4' type=.Ref? origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: CONST Null type=kotlin.Nothing? value=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .Ref' type=kotlin.Unit origin=EQ + $this: GET_VAR 'val tmp_3: .Ref? [val] declared in .test4' type=.Ref? origin=null + : CONST Int type=kotlin.Int value=0 FUN name:test5 visibility:public modality:FINAL <> ($receiver:.IHost, s:kotlin.String?) returnType:kotlin.Int? $receiver: VALUE_PARAMETER name: type:.IHost VALUE_PARAMETER name:s index:0 type:kotlin.String? @@ -156,16 +157,17 @@ FILE fqName: fileName:/safeCalls.kt CONST Int type=kotlin.Int value=239 FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY - BLOCK type=kotlin.Int origin=SAFE_CALL - VAR IR_TEMPORARY_VARIABLE name:tmp_5 type:kotlin.Int [val] - CONST Int type=kotlin.Int value=42 - WHEN type=kotlin.Int origin=null - BRANCH - if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp_5: kotlin.Int [val] declared in .box' type=kotlin.Int origin=null - arg1: CONST Null type=kotlin.Nothing? value=null - then: CONST Null type=kotlin.Nothing? value=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CALL 'public final fun foo (): kotlin.Int declared in ' type=kotlin.Int origin=null - $receiver: GET_VAR 'val tmp_5: kotlin.Int [val] declared in .box' type=kotlin.Int origin=null + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + BLOCK type=kotlin.Int origin=SAFE_CALL + VAR IR_TEMPORARY_VARIABLE name:tmp_5 type:kotlin.Int [val] + CONST Int type=kotlin.Int value=42 + WHEN type=kotlin.Int origin=null + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'val tmp_5: kotlin.Int [val] declared in .box' type=kotlin.Int origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: CONST Null type=kotlin.Nothing? value=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CALL 'public final fun foo (): kotlin.Int declared in ' type=kotlin.Int origin=null + $receiver: GET_VAR 'val tmp_5: kotlin.Int [val] declared in .box' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/expressions/sam/arrayAsVarargAfterSamArgument.fir.txt b/compiler/testData/ir/irText/expressions/sam/arrayAsVarargAfterSamArgument.fir.txt index 290c443ca95..748fa77c30f 100644 --- a/compiler/testData/ir/irText/expressions/sam/arrayAsVarargAfterSamArgument.fir.txt +++ b/compiler/testData/ir/irText/expressions/sam/arrayAsVarargAfterSamArgument.fir.txt @@ -11,43 +11,48 @@ FILE fqName: fileName:/arrayAsVarargAfterSamArgument.kt RETURN type=kotlin.Nothing from='local final fun (): kotlin.Unit declared in .test' GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit GET_VAR 'arr: kotlin.Array declared in .test' type=kotlin.Array origin=null - CALL 'public open fun foo1 (r: java.lang.Runnable?, vararg strs: kotlin.String?): kotlin.String? declared in .Test' type=kotlin.String? origin=null - r: TYPE_OP type=java.lang.Runnable? origin=SAM_CONVERSION typeOperand=java.lang.Runnable? - FUN_EXPR type=kotlin.Function0 origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.Unit - BLOCK_BODY - RETURN type=kotlin.Nothing from='local final fun (): kotlin.Unit declared in .test' - GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit - strs: VARARG type=kotlin.Array? varargElementType=kotlin.String? - SPREAD_ELEMENT - GET_VAR 'arr: kotlin.Array declared in .test' type=kotlin.Array origin=null + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + CALL 'public open fun foo1 (r: java.lang.Runnable?, vararg strs: kotlin.String?): kotlin.String? declared in .Test' type=kotlin.String? origin=null + r: TYPE_OP type=java.lang.Runnable? origin=SAM_CONVERSION typeOperand=java.lang.Runnable? + FUN_EXPR type=kotlin.Function0 origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun (): kotlin.Unit declared in .test' + GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit + strs: VARARG type=kotlin.Array? varargElementType=kotlin.String? + SPREAD_ELEMENT + GET_VAR 'arr: kotlin.Array declared in .test' type=kotlin.Array origin=null ERROR_CALL 'Unresolved reference: #' type=kotlin.String? GET_VAR 'fn: kotlin.Function0 declared in .test' type=kotlin.Function0 origin=null GET_VAR 'arr: kotlin.Array declared in .test' type=kotlin.Array origin=null - CALL 'public open fun foo1 (r: java.lang.Runnable?, vararg strs: kotlin.String?): kotlin.String? declared in .Test' type=kotlin.String? origin=null - r: TYPE_OP type=java.lang.Runnable? origin=SAM_CONVERSION typeOperand=java.lang.Runnable? - GET_VAR 'fn: kotlin.Function0 declared in .test' type=kotlin.Function0 origin=null - strs: VARARG type=kotlin.Array? varargElementType=kotlin.String? - SPREAD_ELEMENT - GET_VAR 'arr: kotlin.Array declared in .test' type=kotlin.Array origin=null - CALL 'public open fun foo1 (r: java.lang.Runnable?, vararg strs: kotlin.String?): kotlin.String? declared in .Test' type=kotlin.String? origin=null - r: GET_VAR 'r: java.lang.Runnable declared in .test' type=java.lang.Runnable origin=null - strs: VARARG type=kotlin.Array? varargElementType=kotlin.String? - CONST String type=kotlin.String value="" + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + CALL 'public open fun foo1 (r: java.lang.Runnable?, vararg strs: kotlin.String?): kotlin.String? declared in .Test' type=kotlin.String? origin=null + r: TYPE_OP type=java.lang.Runnable? origin=SAM_CONVERSION typeOperand=java.lang.Runnable? + GET_VAR 'fn: kotlin.Function0 declared in .test' type=kotlin.Function0 origin=null + strs: VARARG type=kotlin.Array? varargElementType=kotlin.String? + SPREAD_ELEMENT + GET_VAR 'arr: kotlin.Array declared in .test' type=kotlin.Array origin=null + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + CALL 'public open fun foo1 (r: java.lang.Runnable?, vararg strs: kotlin.String?): kotlin.String? declared in .Test' type=kotlin.String? origin=null + r: GET_VAR 'r: java.lang.Runnable declared in .test' type=java.lang.Runnable origin=null + strs: VARARG type=kotlin.Array? varargElementType=kotlin.String? + CONST String type=kotlin.String value="" ERROR_CALL 'Unresolved reference: #' type=kotlin.String? GET_VAR 'fn: kotlin.Function0 declared in .test' type=kotlin.Function0 origin=null GET_VAR 'arr: kotlin.Array declared in .test' type=kotlin.Array origin=null - CALL 'public open fun foo1 (r: java.lang.Runnable?, vararg strs: kotlin.String?): kotlin.String? declared in .Test' type=kotlin.String? origin=null - r: TYPE_OP type=java.lang.Runnable? origin=SAM_CONVERSION typeOperand=java.lang.Runnable? - GET_VAR 'fn: kotlin.Function0 declared in .test' type=kotlin.Function0 origin=null - strs: VARARG type=kotlin.Array? varargElementType=kotlin.String? - SPREAD_ELEMENT - GET_VAR 'arr: kotlin.Array declared in .test' type=kotlin.Array origin=null - CALL 'public open fun foo1 (r: java.lang.Runnable?, vararg strs: kotlin.String?): kotlin.String? declared in .Test' type=kotlin.String? origin=null - r: GET_VAR 'r: java.lang.Runnable declared in .test' type=java.lang.Runnable origin=null - strs: VARARG type=kotlin.Array? varargElementType=kotlin.String? - SPREAD_ELEMENT - GET_VAR 'arr: kotlin.Array declared in .test' type=kotlin.Array origin=null + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + CALL 'public open fun foo1 (r: java.lang.Runnable?, vararg strs: kotlin.String?): kotlin.String? declared in .Test' type=kotlin.String? origin=null + r: TYPE_OP type=java.lang.Runnable? origin=SAM_CONVERSION typeOperand=java.lang.Runnable? + GET_VAR 'fn: kotlin.Function0 declared in .test' type=kotlin.Function0 origin=null + strs: VARARG type=kotlin.Array? varargElementType=kotlin.String? + SPREAD_ELEMENT + GET_VAR 'arr: kotlin.Array declared in .test' type=kotlin.Array origin=null + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + CALL 'public open fun foo1 (r: java.lang.Runnable?, vararg strs: kotlin.String?): kotlin.String? declared in .Test' type=kotlin.String? origin=null + r: GET_VAR 'r: java.lang.Runnable declared in .test' type=java.lang.Runnable origin=null + strs: VARARG type=kotlin.Array? varargElementType=kotlin.String? + SPREAD_ELEMENT + GET_VAR 'arr: kotlin.Array declared in .test' type=kotlin.Array origin=null VAR name:i1 type:IrErrorType [val] ERROR_CALL 'Unresolved reference: #' type=IrErrorType FUN_EXPR type=kotlin.Function0 origin=LAMBDA diff --git a/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall.fir.txt b/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall.fir.txt index fdeaf4cd142..e609956c03f 100644 --- a/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall.fir.txt +++ b/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall.fir.txt @@ -10,10 +10,12 @@ FILE fqName: fileName:/samConversionInGenericConstructorCall.kt FUN name:test2 visibility:public modality:FINAL <> (x:kotlin.Any) returnType:kotlin.Unit VALUE_PARAMETER name:x index:0 type:kotlin.Any BLOCK_BODY - TYPE_OP type=kotlin.Function1 origin=CAST typeOperand=kotlin.Function1 - GET_VAR 'x: kotlin.Any declared in .test2' type=kotlin.Any origin=null - CONSTRUCTOR_CALL 'public constructor (jxx: .J.C?, X of .C?>?) declared in .C' type=.C origin=null - : kotlin.String? - jxx: TYPE_OP type=.J.C?, X of .C?>? origin=SAM_CONVERSION typeOperand=.J.C?, X of .C?>? - TYPE_OP type=kotlin.Function1 origin=IMPLICIT_CAST typeOperand=kotlin.Function1 - GET_VAR 'x: kotlin.Any declared in .test2' type=kotlin.Any origin=null + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + TYPE_OP type=kotlin.Function1 origin=CAST typeOperand=kotlin.Function1 + GET_VAR 'x: kotlin.Any declared in .test2' type=kotlin.Any origin=null + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + CONSTRUCTOR_CALL 'public constructor (jxx: .J.C?, X of .C?>?) declared in .C' type=.C origin=null + : kotlin.String? + jxx: TYPE_OP type=.J.C?, X of .C?>? origin=SAM_CONVERSION typeOperand=.J.C?, X of .C?>? + TYPE_OP type=kotlin.Function1 origin=IMPLICIT_CAST typeOperand=kotlin.Function1 + GET_VAR 'x: kotlin.Any declared in .test2' type=kotlin.Any origin=null diff --git a/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall_NI.fir.txt b/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall_NI.fir.txt index 451119049c6..eddf1c4f215 100644 --- a/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall_NI.fir.txt +++ b/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall_NI.fir.txt @@ -102,11 +102,13 @@ FILE fqName: fileName:/samConversionInGenericConstructorCall_NI.kt FUN name:testGenericJavaCtor2 visibility:public modality:FINAL <> (x:kotlin.Any) returnType:kotlin.Unit VALUE_PARAMETER name:x index:0 type:kotlin.Any BLOCK_BODY - TYPE_OP type=kotlin.Function1 origin=CAST typeOperand=kotlin.Function1 - GET_VAR 'x: kotlin.Any declared in .testGenericJavaCtor2' type=kotlin.Any origin=null - CONSTRUCTOR_CALL 'public constructor (x: .J.G.?, TClass of .G?>?) declared in .G' type=.G origin=null - : kotlin.String? - : kotlin.Int? - x: TYPE_OP type=.J.G.?, TClass of .G?>? origin=SAM_CONVERSION typeOperand=.J.G.?, TClass of .G?>? - TYPE_OP type=kotlin.Function1 origin=IMPLICIT_CAST typeOperand=kotlin.Function1 - GET_VAR 'x: kotlin.Any declared in .testGenericJavaCtor2' type=kotlin.Any origin=null + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + TYPE_OP type=kotlin.Function1 origin=CAST typeOperand=kotlin.Function1 + GET_VAR 'x: kotlin.Any declared in .testGenericJavaCtor2' type=kotlin.Any origin=null + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + CONSTRUCTOR_CALL 'public constructor (x: .J.G.?, TClass of .G?>?) declared in .G' type=.G origin=null + : kotlin.String? + : kotlin.Int? + x: TYPE_OP type=.J.G.?, TClass of .G?>? origin=SAM_CONVERSION typeOperand=.J.G.?, TClass of .G?>? + TYPE_OP type=kotlin.Function1 origin=IMPLICIT_CAST typeOperand=kotlin.Function1 + GET_VAR 'x: kotlin.Any declared in .testGenericJavaCtor2' type=kotlin.Any origin=null diff --git a/compiler/testData/ir/irText/expressions/sam/samConversionToGeneric.fir.txt b/compiler/testData/ir/irText/expressions/sam/samConversionToGeneric.fir.txt index 2f757320516..f42df5fa5fd 100644 --- a/compiler/testData/ir/irText/expressions/sam/samConversionToGeneric.fir.txt +++ b/compiler/testData/ir/irText/expressions/sam/samConversionToGeneric.fir.txt @@ -34,8 +34,9 @@ FILE fqName: fileName:/samConversionToGeneric.kt FUN name:test4 visibility:public modality:FINAL <> (a:kotlin.Any) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:kotlin.Any BLOCK_BODY - TYPE_OP type=.J origin=CAST typeOperand=.J - GET_VAR 'a: kotlin.Any declared in .test4' type=kotlin.Any origin=null + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + TYPE_OP type=.J origin=CAST typeOperand=.J + GET_VAR 'a: kotlin.Any declared in .test4' type=kotlin.Any origin=null CALL 'public open fun bar (j: .J.H.bar?>?): kotlin.Unit declared in .H' type=kotlin.Unit origin=null : kotlin.String? j: TYPE_OP type=.J origin=IMPLICIT_CAST typeOperand=.J @@ -43,8 +44,9 @@ FILE fqName: fileName:/samConversionToGeneric.kt FUN name:test5 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.Function1 origin=CAST typeOperand=kotlin.Function1 - GET_VAR 'a: kotlin.Any declared in .test5' type=kotlin.Any origin=null + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + TYPE_OP type=kotlin.Function1 origin=CAST typeOperand=kotlin.Function1 + GET_VAR 'a: kotlin.Any declared in .test5' type=kotlin.Any origin=null CALL 'public open fun bar (j: .J.H.bar?>?): kotlin.Unit declared in .H' type=kotlin.Unit origin=null : kotlin.String? j: TYPE_OP type=.J.H.bar?>? origin=SAM_CONVERSION typeOperand=.J.H.bar?>? @@ -62,8 +64,9 @@ FILE fqName: fileName:/samConversionToGeneric.kt TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] VALUE_PARAMETER name:a index:0 type:kotlin.Any BLOCK_BODY - TYPE_OP type=kotlin.Function1.test7, T of .test7> origin=CAST typeOperand=kotlin.Function1.test7, T of .test7> - GET_VAR 'a: kotlin.Any declared in .test7' type=kotlin.Any origin=null + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + TYPE_OP type=kotlin.Function1.test7, T of .test7> origin=CAST typeOperand=kotlin.Function1.test7, T of .test7> + GET_VAR 'a: kotlin.Any declared in .test7' type=kotlin.Any origin=null CALL 'public open fun bar (j: .J.H.bar?>?): kotlin.Unit declared in .H' type=kotlin.Unit origin=null : T of .test7? j: TYPE_OP type=.J.H.bar?>? origin=SAM_CONVERSION typeOperand=.J.H.bar?>? diff --git a/compiler/testData/ir/irText/expressions/sam/samConversionsWithSmartCasts.fir.txt b/compiler/testData/ir/irText/expressions/sam/samConversionsWithSmartCasts.fir.txt index 8c23723abba..40cc1ac952e 100644 --- a/compiler/testData/ir/irText/expressions/sam/samConversionsWithSmartCasts.fir.txt +++ b/compiler/testData/ir/irText/expressions/sam/samConversionsWithSmartCasts.fir.txt @@ -66,9 +66,10 @@ FILE fqName: fileName:/samConversionsWithSmartCasts.kt if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=java.lang.Runnable 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 - 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 + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + TYPE_OP type=kotlin.Function0 origin=CAST typeOperand=kotlin.Function0 + 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 declared in .J' type=kotlin.Unit origin=null $this: CONSTRUCTOR_CALL 'public constructor () [primary] declared in .J' type=.J origin=null r: TYPE_OP type=java.lang.Runnable origin=IMPLICIT_CAST typeOperand=java.lang.Runnable @@ -76,8 +77,9 @@ FILE fqName: fileName:/samConversionsWithSmartCasts.kt 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 + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + 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 open fun run1 (r: java.lang.Runnable?): kotlin.Unit declared in .J' type=kotlin.Unit origin=null $this: CONSTRUCTOR_CALL 'public constructor () [primary] declared in .J' type=.J origin=null r: TYPE_OP type=java.lang.Runnable? origin=SAM_CONVERSION typeOperand=java.lang.Runnable? @@ -86,8 +88,9 @@ FILE fqName: fileName:/samConversionsWithSmartCasts.kt FUN name:test7 visibility:public modality:FINAL <> (a:kotlin.Function1) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:kotlin.Function1 BLOCK_BODY - TYPE_OP type=kotlin.Function0 origin=CAST typeOperand=kotlin.Function0 - GET_VAR 'a: kotlin.Function1 declared in .test7' type=kotlin.Function1 origin=null + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + TYPE_OP type=kotlin.Function0 origin=CAST typeOperand=kotlin.Function0 + GET_VAR 'a: kotlin.Function1 declared in .test7' type=kotlin.Function1 origin=null ERROR_CALL 'Unresolved reference: #' type=kotlin.Unit TYPE_OP type=kotlin.Function0 origin=IMPLICIT_CAST typeOperand=kotlin.Function0 GET_VAR 'a: kotlin.Function1 declared in .test7' type=kotlin.Function1 origin=null diff --git a/compiler/testData/ir/irText/expressions/suspendConversionOnArbitraryExpression.fir.txt b/compiler/testData/ir/irText/expressions/suspendConversionOnArbitraryExpression.fir.txt index 56472a22a6d..9ae2b92af71 100644 --- a/compiler/testData/ir/irText/expressions/suspendConversionOnArbitraryExpression.fir.txt +++ b/compiler/testData/ir/irText/expressions/suspendConversionOnArbitraryExpression.fir.txt @@ -95,8 +95,9 @@ FILE fqName: fileName:/suspendConversionOnArbitraryExpression.kt FUN name:testSmartCastWithSuspendConversion 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 .testSmartCastWithSuspendConversion' type=kotlin.Any origin=null + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + TYPE_OP type=kotlin.Function0 origin=CAST typeOperand=kotlin.Function0 + GET_VAR 'a: kotlin.Any declared in .testSmartCastWithSuspendConversion' type=kotlin.Any origin=null ERROR_CALL 'Unresolved reference: #' type=kotlin.Unit TYPE_OP type=kotlin.Function0 origin=IMPLICIT_CAST typeOperand=kotlin.Function0 GET_VAR 'a: kotlin.Any declared in .testSmartCastWithSuspendConversion' type=kotlin.Any origin=null @@ -105,16 +106,18 @@ FILE fqName: fileName:/suspendConversionOnArbitraryExpression.kt BLOCK_BODY VAR name:b type:kotlin.Any [var] GET_VAR 'a: kotlin.Any declared in .testSmartCastOnVarWithSuspendConversion' type=kotlin.Any origin=null - TYPE_OP type=kotlin.Function0 origin=CAST typeOperand=kotlin.Function0 - GET_VAR 'var b: kotlin.Any [var] declared in .testSmartCastOnVarWithSuspendConversion' type=kotlin.Any origin=null + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + TYPE_OP type=kotlin.Function0 origin=CAST typeOperand=kotlin.Function0 + GET_VAR 'var b: kotlin.Any [var] declared in .testSmartCastOnVarWithSuspendConversion' type=kotlin.Any origin=null ERROR_CALL 'Unresolved reference: #' type=kotlin.Unit TYPE_OP type=kotlin.Function0 origin=IMPLICIT_CAST typeOperand=kotlin.Function0 GET_VAR 'var b: kotlin.Any [var] declared in .testSmartCastOnVarWithSuspendConversion' type=kotlin.Any origin=null FUN name:testSmartCastVsSuspendConversion visibility:public modality:FINAL <> (a:kotlin.Function0) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:kotlin.Function0 BLOCK_BODY - TYPE_OP type=kotlin.coroutines.SuspendFunction0 origin=CAST typeOperand=kotlin.coroutines.SuspendFunction0 - GET_VAR 'a: kotlin.Function0 declared in .testSmartCastVsSuspendConversion' type=kotlin.Function0 origin=null + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + TYPE_OP type=kotlin.coroutines.SuspendFunction0 origin=CAST typeOperand=kotlin.coroutines.SuspendFunction0 + GET_VAR 'a: kotlin.Function0 declared in .testSmartCastVsSuspendConversion' type=kotlin.Function0 origin=null CALL 'public final fun useSuspend (sfn: kotlin.coroutines.SuspendFunction0): kotlin.Unit declared in ' type=kotlin.Unit origin=null sfn: TYPE_OP type=kotlin.coroutines.SuspendFunction0 origin=IMPLICIT_CAST typeOperand=kotlin.coroutines.SuspendFunction0 GET_VAR 'a: kotlin.Function0 declared in .testSmartCastVsSuspendConversion' type=kotlin.Function0 origin=null @@ -123,8 +126,9 @@ FILE fqName: fileName:/suspendConversionOnArbitraryExpression.kt BLOCK_BODY VAR name:b type:kotlin.Function0 [var] GET_VAR 'a: kotlin.Function0 declared in .testSmartCastOnVarVsSuspendConversion' type=kotlin.Function0 origin=null - TYPE_OP type=kotlin.coroutines.SuspendFunction0 origin=CAST typeOperand=kotlin.coroutines.SuspendFunction0 - GET_VAR 'var b: kotlin.Function0 [var] declared in .testSmartCastOnVarVsSuspendConversion' type=kotlin.Function0 origin=null + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + TYPE_OP type=kotlin.coroutines.SuspendFunction0 origin=CAST typeOperand=kotlin.coroutines.SuspendFunction0 + GET_VAR 'var b: kotlin.Function0 [var] declared in .testSmartCastOnVarVsSuspendConversion' type=kotlin.Function0 origin=null CALL 'public final fun useSuspend (sfn: kotlin.coroutines.SuspendFunction0): kotlin.Unit declared in ' type=kotlin.Unit origin=null sfn: GET_VAR 'var b: kotlin.Function0 [var] declared in .testSmartCastOnVarVsSuspendConversion' type=kotlin.Function0 origin=null FUN name:testIntersectionVsSuspendConversion visibility:public modality:FINAL (x:T of .testIntersectionVsSuspendConversion) returnType:kotlin.Unit diff --git a/compiler/testData/ir/irText/expressions/whenUnusedExpression.fir.txt b/compiler/testData/ir/irText/expressions/whenUnusedExpression.fir.txt index 93b136c175f..e8ff3ebd3cc 100644 --- a/compiler/testData/ir/irText/expressions/whenUnusedExpression.fir.txt +++ b/compiler/testData/ir/irText/expressions/whenUnusedExpression.fir.txt @@ -3,21 +3,22 @@ FILE fqName: fileName:/whenUnusedExpression.kt VALUE_PARAMETER name:b index:0 type:kotlin.Boolean VALUE_PARAMETER name:i index:1 type:kotlin.Int BLOCK_BODY - WHEN type=kotlin.Int? origin=IF - BRANCH - if: GET_VAR 'b: kotlin.Boolean declared in .test' type=kotlin.Boolean origin=null - then: BLOCK type=kotlin.Int? origin=WHEN - VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.Int [val] - GET_VAR 'i: kotlin.Int declared in .test' type=kotlin.Int 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_0: kotlin.Int [val] declared in .test' type=kotlin.Int origin=null - arg1: CONST Int type=kotlin.Int value=0 - then: CONST Int type=kotlin.Int value=1 - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST Null type=kotlin.Nothing? value=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST Null type=kotlin.Nothing? value=null + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + WHEN type=kotlin.Int? origin=IF + BRANCH + if: GET_VAR 'b: kotlin.Boolean declared in .test' type=kotlin.Boolean origin=null + then: BLOCK type=kotlin.Int? origin=WHEN + VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.Int [val] + GET_VAR 'i: kotlin.Int declared in .test' type=kotlin.Int 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_0: kotlin.Int [val] declared in .test' type=kotlin.Int origin=null + arg1: CONST Int type=kotlin.Int value=0 + then: CONST Int type=kotlin.Int value=1 + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Null type=kotlin.Nothing? value=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Null type=kotlin.Nothing? value=null diff --git a/compiler/testData/ir/irText/lambdas/localFunction.fir.txt b/compiler/testData/ir/irText/lambdas/localFunction.fir.txt index f0bc40a163f..258ccd332e1 100644 --- a/compiler/testData/ir/irText/lambdas/localFunction.fir.txt +++ b/compiler/testData/ir/irText/lambdas/localFunction.fir.txt @@ -10,5 +10,6 @@ FILE fqName: fileName:/localFunction.kt SET_VAR 'var x: kotlin.Int [var] declared in .outer' type=kotlin.Unit origin=EQ 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 .outer.local' type=kotlin.Int origin=null - GET_VAR 'val tmp_0: kotlin.Int [val] declared in .outer.local' type=kotlin.Int origin=null + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + GET_VAR 'val tmp_0: kotlin.Int [val] declared in .outer.local' type=kotlin.Int origin=null CALL 'local final fun local (): kotlin.Unit declared in .outer' type=kotlin.Unit origin=null diff --git a/compiler/testData/ir/irText/lambdas/multipleImplicitReceivers.fir.txt b/compiler/testData/ir/irText/lambdas/multipleImplicitReceivers.fir.txt index 19b8e0ace2a..7e81e71b4c3 100644 --- a/compiler/testData/ir/irText/lambdas/multipleImplicitReceivers.fir.txt +++ b/compiler/testData/ir/irText/lambdas/multipleImplicitReceivers.fir.txt @@ -85,35 +85,36 @@ FILE fqName: fileName:/multipleImplicitReceivers.kt VALUE_PARAMETER name:fooImpl index:0 type:.IFoo VALUE_PARAMETER name:invokeImpl index:1 type:.IInvoke BLOCK_BODY - CALL 'public final fun with (receiver: T of kotlin.with, block: @[ExtensionFunctionType] kotlin.Function1): R of kotlin.with [inline] declared in kotlin' type=kotlin.Int origin=null - : .A - : kotlin.Int - receiver: GET_OBJECT 'CLASS OBJECT name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.A - block: FUN_EXPR type=kotlin.Function1<.A, kotlin.Int> origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:.A) returnType:kotlin.Int - $receiver: VALUE_PARAMETER name: type:.A - BLOCK_BODY - RETURN type=kotlin.Nothing from='local final fun (): kotlin.Int declared in .test' - CALL 'public final fun with (receiver: T of kotlin.with, block: @[ExtensionFunctionType] kotlin.Function1): R of kotlin.with [inline] declared in kotlin' type=kotlin.Int origin=null - : .IFoo - : kotlin.Int - receiver: GET_VAR 'fooImpl: .IFoo declared in .test' type=.IFoo origin=null - block: FUN_EXPR type=kotlin.Function1<.IFoo, kotlin.Int> origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:.IFoo) returnType:kotlin.Int - $receiver: VALUE_PARAMETER name: type:.IFoo - BLOCK_BODY - RETURN type=kotlin.Nothing from='local final fun (): kotlin.Int declared in .test.' - CALL 'public final fun with (receiver: T of kotlin.with, block: @[ExtensionFunctionType] kotlin.Function1): R of kotlin.with [inline] declared in kotlin' type=kotlin.Int origin=null - : .IInvoke - : kotlin.Int - receiver: GET_VAR 'invokeImpl: .IInvoke declared in .test' type=.IInvoke origin=null - block: FUN_EXPR type=kotlin.Function1<.IInvoke, kotlin.Int> origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:.IInvoke) returnType:kotlin.Int - $receiver: VALUE_PARAMETER name: type:.IInvoke - BLOCK_BODY - RETURN type=kotlin.Nothing from='local final fun (): kotlin.Int declared in .test..' - CALL 'public open fun invoke (): kotlin.Int [operator] declared in .IInvoke' type=kotlin.Int origin=null - $this: GET_VAR ': .IInvoke declared in .test...' type=.IInvoke origin=null - $receiver: CALL 'public open fun (): .B declared in .IFoo' type=.B origin=GET_PROPERTY - $this: GET_VAR ': .IFoo declared in .test..' type=.IFoo origin=null - $receiver: GET_VAR ': .A declared in .test.' type=.A origin=null + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + CALL 'public final fun with (receiver: T of kotlin.with, block: @[ExtensionFunctionType] kotlin.Function1): R of kotlin.with [inline] declared in kotlin' type=kotlin.Int origin=null + : .A + : kotlin.Int + receiver: GET_OBJECT 'CLASS OBJECT name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.A + block: FUN_EXPR type=kotlin.Function1<.A, kotlin.Int> origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:.A) returnType:kotlin.Int + $receiver: VALUE_PARAMETER name: type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun (): kotlin.Int declared in .test' + CALL 'public final fun with (receiver: T of kotlin.with, block: @[ExtensionFunctionType] kotlin.Function1): R of kotlin.with [inline] declared in kotlin' type=kotlin.Int origin=null + : .IFoo + : kotlin.Int + receiver: GET_VAR 'fooImpl: .IFoo declared in .test' type=.IFoo origin=null + block: FUN_EXPR type=kotlin.Function1<.IFoo, kotlin.Int> origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:.IFoo) returnType:kotlin.Int + $receiver: VALUE_PARAMETER name: type:.IFoo + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun (): kotlin.Int declared in .test.' + CALL 'public final fun with (receiver: T of kotlin.with, block: @[ExtensionFunctionType] kotlin.Function1): R of kotlin.with [inline] declared in kotlin' type=kotlin.Int origin=null + : .IInvoke + : kotlin.Int + receiver: GET_VAR 'invokeImpl: .IInvoke declared in .test' type=.IInvoke origin=null + block: FUN_EXPR type=kotlin.Function1<.IInvoke, kotlin.Int> origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:.IInvoke) returnType:kotlin.Int + $receiver: VALUE_PARAMETER name: type:.IInvoke + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun (): kotlin.Int declared in .test..' + CALL 'public open fun invoke (): kotlin.Int [operator] declared in .IInvoke' type=kotlin.Int origin=null + $this: GET_VAR ': .IInvoke declared in .test...' type=.IInvoke origin=null + $receiver: CALL 'public open fun (): .B declared in .IFoo' type=.B origin=GET_PROPERTY + $this: GET_VAR ': .IFoo declared in .test..' type=.IFoo origin=null + $receiver: GET_VAR ': .A declared in .test.' type=.A origin=null diff --git a/compiler/testData/ir/irText/types/asOnPlatformType.fir.txt b/compiler/testData/ir/irText/types/asOnPlatformType.fir.txt index f876d435f15..97aeb566a43 100644 --- a/compiler/testData/ir/irText/types/asOnPlatformType.fir.txt +++ b/compiler/testData/ir/irText/types/asOnPlatformType.fir.txt @@ -5,18 +5,22 @@ FILE fqName: fileName:/asOnPlatformType.kt CALL 'public open fun nullString (): kotlin.String? declared in .JavaClass' type=kotlin.String? origin=null VAR name:nonnullStr type:kotlin.String? [val] CALL 'public open fun nonnullString (): kotlin.String? declared in .JavaClass' type=kotlin.String? origin=null - CALL 'public final fun foo (): T of .foo [inline] declared in ' type=kotlin.String? origin=null - : kotlin.String? - $receiver: GET_VAR 'val nullStr: kotlin.String? [val] declared in .test' type=kotlin.String? origin=null - CALL 'public final fun foo (): T of .foo [inline] declared in ' type=kotlin.String? origin=null - : kotlin.String? - $receiver: GET_VAR 'val nonnullStr: kotlin.String? [val] declared in .test' type=kotlin.String? origin=null - CALL 'public final fun fooN (): T of .fooN? [inline] declared in ' type=kotlin.String? origin=null - : kotlin.String? - $receiver: GET_VAR 'val nullStr: kotlin.String? [val] declared in .test' type=kotlin.String? origin=null - CALL 'public final fun fooN (): T of .fooN? [inline] declared in ' type=kotlin.String? origin=null - : kotlin.String? - $receiver: GET_VAR 'val nonnullStr: kotlin.String? [val] declared in .test' type=kotlin.String? origin=null + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + CALL 'public final fun foo (): T of .foo [inline] declared in ' type=kotlin.String? origin=null + : kotlin.String? + $receiver: GET_VAR 'val nullStr: kotlin.String? [val] declared in .test' type=kotlin.String? origin=null + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + CALL 'public final fun foo (): T of .foo [inline] declared in ' type=kotlin.String? origin=null + : kotlin.String? + $receiver: GET_VAR 'val nonnullStr: kotlin.String? [val] declared in .test' type=kotlin.String? origin=null + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + CALL 'public final fun fooN (): T of .fooN? [inline] declared in ' type=kotlin.String? origin=null + : kotlin.String? + $receiver: GET_VAR 'val nullStr: kotlin.String? [val] declared in .test' type=kotlin.String? origin=null + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + CALL 'public final fun fooN (): T of .fooN? [inline] declared in ' type=kotlin.String? origin=null + : kotlin.String? + $receiver: GET_VAR 'val nonnullStr: kotlin.String? [val] declared in .test' type=kotlin.String? origin=null FUN name:foo visibility:public modality:FINAL ($receiver:T of .foo) returnType:T of .foo [inline] TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] $receiver: VALUE_PARAMETER name: type:T of .foo diff --git a/compiler/testData/ir/irText/types/genericPropertyReferenceType.fir.txt b/compiler/testData/ir/irText/types/genericPropertyReferenceType.fir.txt index b7e6168a23c..34648e202b5 100644 --- a/compiler/testData/ir/irText/types/genericPropertyReferenceType.fir.txt +++ b/compiler/testData/ir/irText/types/genericPropertyReferenceType.fir.txt @@ -71,8 +71,9 @@ FILE fqName: fileName:/genericPropertyReferenceType.kt FUN name:test2 visibility:public modality:FINAL <> (a:kotlin.Any) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:kotlin.Any BLOCK_BODY - TYPE_OP type=.C origin=CAST typeOperand=.C - GET_VAR 'a: kotlin.Any declared in .test2' type=kotlin.Any origin=null + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + TYPE_OP type=.C origin=CAST typeOperand=.C + GET_VAR 'a: kotlin.Any declared in .test2' type=kotlin.Any origin=null CALL 'public final fun use (p: kotlin.reflect.KMutableProperty): kotlin.Unit declared in ' type=kotlin.Unit origin=null p: PROPERTY_REFERENCE 'public final y: T of . [var]' field=null getter='public final fun (): T of . declared in ' setter='public final fun (v: T of .): kotlin.Unit declared in ' type=kotlin.reflect.KMutableProperty0 origin=null <1>: kotlin.String diff --git a/compiler/testData/ir/irText/types/inStarProjectionInReceiverType.fir.txt b/compiler/testData/ir/irText/types/inStarProjectionInReceiverType.fir.txt deleted file mode 100644 index 0de41404db1..00000000000 --- a/compiler/testData/ir/irText/types/inStarProjectionInReceiverType.fir.txt +++ /dev/null @@ -1,45 +0,0 @@ -FILE fqName: fileName:/inStarProjectionInReceiverType.kt - CLASS INTERFACE name:Foo modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Foo.Foo> - TYPE_PARAMETER name:T index:0 variance:in superTypes:[kotlin.Any?] - PROPERTY name:x visibility:public modality:ABSTRACT [val] - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.Foo.Foo>) returnType:kotlin.Int - correspondingProperty: PROPERTY name:x visibility:public modality:ABSTRACT [val] - $this: VALUE_PARAMETER name: type:.Foo.Foo> - FUN name:foo visibility:public modality:ABSTRACT <> ($this:.Foo.Foo>, x:T of .Foo) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.Foo.Foo> - VALUE_PARAMETER name:x index:0 type:T of .Foo - 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 - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:testReceiver visibility:public modality:FINAL <> ($receiver:.Foo<*>) returnType:kotlin.Int - $receiver: VALUE_PARAMETER name: type:.Foo<*> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testReceiver (): kotlin.Int declared in ' - CALL 'public abstract fun (): kotlin.Int declared in .Foo' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR ': .Foo<*> declared in .testReceiver' type=.Foo<*> origin=null - FUN name:testSmartCastOnExtensionReceiver visibility:public modality:FINAL <> ($receiver:.Foo<*>) returnType:kotlin.Unit - $receiver: VALUE_PARAMETER name: type:.Foo<*> - BLOCK_BODY - TYPE_OP type=.Foo origin=CAST typeOperand=.Foo - GET_VAR ': .Foo<*> declared in .testSmartCastOnExtensionReceiver' type=.Foo<*> origin=null - CALL 'public abstract fun foo (x: T of .Foo): kotlin.Unit declared in .Foo' type=kotlin.Unit origin=null - $this: TYPE_OP type=.Foo origin=IMPLICIT_CAST typeOperand=.Foo - GET_VAR ': .Foo<*> declared in .testSmartCastOnExtensionReceiver' type=.Foo<*> origin=null - x: CONST String type=kotlin.String value="string" - FUN name:testValueParameter visibility:public modality:FINAL <> (vp:.Foo<*>) returnType:kotlin.Int - VALUE_PARAMETER name:vp index:0 type:.Foo<*> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testValueParameter (vp: .Foo<*>): kotlin.Int declared in ' - CALL 'public abstract fun (): kotlin.Int declared in .Foo' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR 'vp: .Foo<*> declared in .testValueParameter' type=.Foo<*> origin=null diff --git a/compiler/testData/ir/irText/types/inStarProjectionInReceiverType.kt b/compiler/testData/ir/irText/types/inStarProjectionInReceiverType.kt index 0f018d9948a..cf59c7581c1 100644 --- a/compiler/testData/ir/irText/types/inStarProjectionInReceiverType.kt +++ b/compiler/testData/ir/irText/types/inStarProjectionInReceiverType.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +NewInference interface Foo { diff --git a/compiler/testData/ir/irText/types/intersectionType1_NI.fir.txt b/compiler/testData/ir/irText/types/intersectionType1_NI.fir.txt index 1e85b86ae95..fe74267ab44 100644 --- a/compiler/testData/ir/irText/types/intersectionType1_NI.fir.txt +++ b/compiler/testData/ir/irText/types/intersectionType1_NI.fir.txt @@ -63,7 +63,8 @@ FILE fqName: fileName:/intersectionType1_NI.kt elements: VARARG type=kotlin.Array.In> varargElementType=.In CONSTRUCTOR_CALL 'public constructor () [primary] declared in .In' type=.In origin=null : kotlin.String - CALL 'public final fun foo (a: kotlin.Array<.In.foo>>, b: kotlin.Array<.In>): kotlin.Boolean declared in ' type=kotlin.Boolean origin=null - : kotlin.Int - a: GET_VAR 'val a1: kotlin.Array<.In> [val] declared in .test' type=kotlin.Array<.In> origin=null - b: GET_VAR 'val a2: kotlin.Array<.In> [val] declared in .test' type=kotlin.Array<.In> origin=null + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + CALL 'public final fun foo (a: kotlin.Array<.In.foo>>, b: kotlin.Array<.In>): kotlin.Boolean declared in ' type=kotlin.Boolean origin=null + : kotlin.Int + a: GET_VAR 'val a1: kotlin.Array<.In> [val] declared in .test' type=kotlin.Array<.In> origin=null + b: GET_VAR 'val a2: kotlin.Array<.In> [val] declared in .test' type=kotlin.Array<.In> origin=null diff --git a/compiler/testData/ir/irText/types/intersectionType1_OI.fir.txt b/compiler/testData/ir/irText/types/intersectionType1_OI.fir.txt index 6daf5791e5a..0c9ecd4f751 100644 --- a/compiler/testData/ir/irText/types/intersectionType1_OI.fir.txt +++ b/compiler/testData/ir/irText/types/intersectionType1_OI.fir.txt @@ -63,7 +63,8 @@ FILE fqName: fileName:/intersectionType1_OI.kt elements: VARARG type=kotlin.Array.In> varargElementType=.In CONSTRUCTOR_CALL 'public constructor () [primary] declared in .In' type=.In origin=null : kotlin.String - CALL 'public final fun foo (a: kotlin.Array<.In.foo>>, b: kotlin.Array<.In>): kotlin.Boolean declared in ' type=kotlin.Boolean origin=null - : kotlin.Int - a: GET_VAR 'val a1: kotlin.Array<.In> [val] declared in .test' type=kotlin.Array<.In> origin=null - b: GET_VAR 'val a2: kotlin.Array<.In> [val] declared in .test' type=kotlin.Array<.In> origin=null + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + CALL 'public final fun foo (a: kotlin.Array<.In.foo>>, b: kotlin.Array<.In>): kotlin.Boolean declared in ' type=kotlin.Boolean origin=null + : kotlin.Int + a: GET_VAR 'val a1: kotlin.Array<.In> [val] declared in .test' type=kotlin.Array<.In> origin=null + b: GET_VAR 'val a2: kotlin.Array<.In> [val] declared in .test' type=kotlin.Array<.In> origin=null diff --git a/compiler/testData/ir/irText/types/intersectionType3_NI.fir.txt b/compiler/testData/ir/irText/types/intersectionType3_NI.fir.txt index d3685e54798..8b71ba0b682 100644 --- a/compiler/testData/ir/irText/types/intersectionType3_NI.fir.txt +++ b/compiler/testData/ir/irText/types/intersectionType3_NI.fir.txt @@ -26,8 +26,9 @@ FILE fqName: fileName:/intersectionType3_NI.kt TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] $receiver: VALUE_PARAMETER name: type:.In.asT> BLOCK_BODY - TYPE_OP type=T of .asT origin=CAST typeOperand=T of .asT - GET_VAR ': .In.asT> declared in .asT' type=.In.asT> origin=null + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + TYPE_OP type=T of .asT origin=CAST typeOperand=T of .asT + GET_VAR ': .In.asT> declared in .asT' type=.In.asT> origin=null FUN name:sel visibility:public modality:FINAL (x:S of .sel, y:S of .sel) returnType:S of .sel TYPE_PARAMETER name:S index:0 variance: superTypes:[kotlin.Any?] VALUE_PARAMETER name:x index:0 type:S of .sel diff --git a/compiler/testData/ir/irText/types/intersectionType3_OI.fir.txt b/compiler/testData/ir/irText/types/intersectionType3_OI.fir.txt index f699897e74c..99a49a39bf9 100644 --- a/compiler/testData/ir/irText/types/intersectionType3_OI.fir.txt +++ b/compiler/testData/ir/irText/types/intersectionType3_OI.fir.txt @@ -26,8 +26,9 @@ FILE fqName: fileName:/intersectionType3_OI.kt TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] $receiver: VALUE_PARAMETER name: type:.In.asT> BLOCK_BODY - TYPE_OP type=T of .asT origin=CAST typeOperand=T of .asT - GET_VAR ': .In.asT> declared in .asT' type=.In.asT> origin=null + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + TYPE_OP type=T of .asT origin=CAST typeOperand=T of .asT + GET_VAR ': .In.asT> declared in .asT' type=.In.asT> origin=null FUN name:sel visibility:public modality:FINAL (x:S of .sel, y:S of .sel) returnType:S of .sel TYPE_PARAMETER name:S index:0 variance: superTypes:[kotlin.Any?] VALUE_PARAMETER name:x index:0 type:S of .sel diff --git a/compiler/testData/ir/irText/types/nullChecks/implicitNotNullOnPlatformType.fir.txt b/compiler/testData/ir/irText/types/nullChecks/implicitNotNullOnPlatformType.fir.txt index 5fbd60a5dae..897c17792b2 100644 --- a/compiler/testData/ir/irText/types/nullChecks/implicitNotNullOnPlatformType.fir.txt +++ b/compiler/testData/ir/irText/types/nullChecks/implicitNotNullOnPlatformType.fir.txt @@ -69,9 +69,11 @@ FILE fqName: fileName:/implicitNotNullOnPlatformType.kt FUN name:testContains visibility:public modality:FINAL <> (m:.MySet) returnType:kotlin.Unit VALUE_PARAMETER name:m index:0 type:.MySet BLOCK_BODY - CALL 'public final fun contains (element: kotlin.String): kotlin.Boolean declared in .MySet' type=kotlin.Boolean origin=null - $this: GET_VAR 'm: .MySet declared in .testContains' type=.MySet origin=null - element: GET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:STRING type:kotlin.String? visibility:public [static]' type=kotlin.String? origin=GET_PROPERTY - CALL 'public final fun contains (element: kotlin.String): kotlin.Boolean declared in .MySet' type=kotlin.Boolean origin=null - $this: GET_VAR 'm: .MySet declared in .testContains' type=.MySet origin=null - element: CONST String type=kotlin.String value="abc" + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + CALL 'public final fun contains (element: kotlin.String): kotlin.Boolean declared in .MySet' type=kotlin.Boolean origin=null + $this: GET_VAR 'm: .MySet declared in .testContains' type=.MySet origin=null + element: GET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:STRING type:kotlin.String? visibility:public [static]' type=kotlin.String? origin=GET_PROPERTY + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + CALL 'public final fun contains (element: kotlin.String): kotlin.Boolean declared in .MySet' type=kotlin.Boolean origin=null + $this: GET_VAR 'm: .MySet declared in .testContains' type=.MySet origin=null + element: CONST String type=kotlin.String value="abc" diff --git a/compiler/testData/ir/irText/types/smartCastOnFakeOverrideReceiver.fir.txt b/compiler/testData/ir/irText/types/smartCastOnFakeOverrideReceiver.fir.txt index 7496bf918ee..47812f5c45c 100644 --- a/compiler/testData/ir/irText/types/smartCastOnFakeOverrideReceiver.fir.txt +++ b/compiler/testData/ir/irText/types/smartCastOnFakeOverrideReceiver.fir.txt @@ -182,14 +182,17 @@ FILE fqName: fileName:/smartCastOnFakeOverrideReceiver.kt $this: VALUE_PARAMETER name: type:.GB.GB, S of .GB> VALUE_PARAMETER name:a index:0 type:kotlin.Any BLOCK_BODY - 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: 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=GET_PROPERTY - $this: TYPE_OP type=.GB origin=IMPLICIT_CAST typeOperand=.GB + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + TYPE_OP type=.GB origin=CAST typeOperand=.GB GET_VAR 'a: kotlin.Any declared in .GB.testGB1' type=kotlin.Any origin=null + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + CALL 'public final fun f (): kotlin.Int declared in .GA' type=kotlin.Int 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 + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + CALL 'public final fun (): kotlin.Int declared in .GA' type=kotlin.Int origin=GET_PROPERTY + $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.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 bd7196c7ec1..62ae2c87c1d 100644 --- a/compiler/testData/ir/irText/types/smartCastOnFieldReceiverOfGenericType.fir.txt +++ b/compiler/testData/ir/irText/types/smartCastOnFieldReceiverOfGenericType.fir.txt @@ -3,10 +3,12 @@ FILE fqName: fileName:/smartCastOnFieldReceiverOfGenericType.kt VALUE_PARAMETER name:a index:0 type:kotlin.Any VALUE_PARAMETER name:b index:1 type:kotlin.Any BLOCK_BODY - TYPE_OP type=.JCell origin=CAST typeOperand=.JCell - GET_VAR 'a: kotlin.Any declared in .testSetField' type=kotlin.Any origin=null - TYPE_OP type=kotlin.String origin=CAST typeOperand=kotlin.String - GET_VAR 'b: kotlin.Any declared in .testSetField' type=kotlin.Any origin=null + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + TYPE_OP type=.JCell origin=CAST typeOperand=.JCell + GET_VAR 'a: kotlin.Any declared in .testSetField' type=kotlin.Any origin=null + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + 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=EQ receiver: TYPE_OP type=.JCell origin=IMPLICIT_CAST typeOperand=.JCell GET_VAR 'a: kotlin.Any declared in .testSetField' type=kotlin.Any origin=null @@ -15,8 +17,9 @@ FILE fqName: fileName:/smartCastOnFieldReceiverOfGenericType.kt FUN name:testGetField visibility:public modality:FINAL <> (a:kotlin.Any) returnType:kotlin.String VALUE_PARAMETER name:a index:0 type:kotlin.Any BLOCK_BODY - TYPE_OP type=.JCell origin=CAST typeOperand=.JCell - GET_VAR 'a: kotlin.Any declared in .testGetField' type=kotlin.Any origin=null + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + TYPE_OP type=.JCell origin=CAST typeOperand=.JCell + 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: TYPE_OP type=.JCell origin=IMPLICIT_CAST typeOperand=.JCell diff --git a/compiler/testData/ir/irText/types/smartCastOnReceiverOfGenericType.fir.txt b/compiler/testData/ir/irText/types/smartCastOnReceiverOfGenericType.fir.txt deleted file mode 100644 index 9b54f96f2b5..00000000000 --- a/compiler/testData/ir/irText/types/smartCastOnReceiverOfGenericType.fir.txt +++ /dev/null @@ -1,145 +0,0 @@ -FILE fqName: fileName:/smartCastOnReceiverOfGenericType.kt - FUN name:testFunction 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 - BLOCK_BODY - TYPE_OP type=kotlin.collections.MutableList origin=CAST typeOperand=kotlin.collections.MutableList - GET_VAR 'a: kotlin.Any declared in .testFunction' type=kotlin.Any origin=null - 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: E of kotlin.collections.MutableList): kotlin.Boolean declared in kotlin.collections.MutableList' type=kotlin.Boolean 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 - BLOCK_BODY - TYPE_OP type=.Cell origin=CAST typeOperand=.Cell - GET_VAR 'a: kotlin.Any declared in .testProperty' type=kotlin.Any origin=null - TYPE_OP type=kotlin.String origin=CAST typeOperand=kotlin.String - GET_VAR 'b: kotlin.Any declared in .testProperty' type=kotlin.Any origin=null - CALL 'public final fun (: T of .Cell): kotlin.Unit declared in .Cell' type=kotlin.Unit origin=EQ - $this: TYPE_OP type=.Cell origin=IMPLICIT_CAST typeOperand=.Cell - GET_VAR 'a: kotlin.Any declared in .testProperty' type=kotlin.Any origin=null - : TYPE_OP type=kotlin.String origin=IMPLICIT_CAST typeOperand=kotlin.String - GET_VAR 'b: kotlin.Any declared in .testProperty' type=kotlin.Any origin=null - FUN name:testInnerClass visibility:public modality:FINAL <> (a:kotlin.Any, b:kotlin.Any, c:kotlin.Any) returnType:kotlin.Unit - VALUE_PARAMETER name:a index:0 type:kotlin.Any - VALUE_PARAMETER name:b index:1 type:kotlin.Any - VALUE_PARAMETER name:c index:2 type:kotlin.Any - BLOCK_BODY - TYPE_OP type=.Outer.Inner origin=CAST typeOperand=.Outer.Inner - GET_VAR 'a: kotlin.Any declared in .testInnerClass' type=kotlin.Any origin=null - TYPE_OP type=kotlin.Int origin=CAST typeOperand=kotlin.Int - GET_VAR 'b: kotlin.Any declared in .testInnerClass' type=kotlin.Any origin=null - TYPE_OP type=kotlin.String origin=CAST typeOperand=kotlin.String - GET_VAR 'c: kotlin.Any declared in .testInnerClass' type=kotlin.Any origin=null - CALL 'public final fun use (x1: T1 of .Outer, x2: T2 of .Outer.Inner): kotlin.Unit declared in .Outer.Inner' type=kotlin.Unit origin=null - $this: TYPE_OP type=.Outer.Inner origin=IMPLICIT_CAST typeOperand=.Outer.Inner - GET_VAR 'a: kotlin.Any declared in .testInnerClass' type=kotlin.Any origin=null - x1: TYPE_OP type=kotlin.Int origin=IMPLICIT_CAST typeOperand=kotlin.Int - GET_VAR 'b: kotlin.Any declared in .testInnerClass' type=kotlin.Any origin=null - x2: TYPE_OP type=kotlin.String origin=IMPLICIT_CAST typeOperand=kotlin.String - GET_VAR 'c: kotlin.Any declared in .testInnerClass' type=kotlin.Any origin=null - FUN name:testNonSubstitutedTypeParameter visibility:public modality:FINAL (a:kotlin.Any, b:kotlin.Any) returnType:kotlin.Unit - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] - VALUE_PARAMETER name:a index:0 type:kotlin.Any - VALUE_PARAMETER name:b index:1 type:kotlin.Any - BLOCK_BODY - TYPE_OP type=kotlin.collections.MutableList.testNonSubstitutedTypeParameter>> origin=CAST typeOperand=kotlin.collections.MutableList.testNonSubstitutedTypeParameter>> - GET_VAR 'a: kotlin.Any declared in .testNonSubstitutedTypeParameter' type=kotlin.Any origin=null - 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: E of kotlin.collections.MutableList): kotlin.Boolean declared in kotlin.collections.MutableList' type=kotlin.Boolean 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.Cell> - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] - CONSTRUCTOR visibility:public <> (value:T of .Cell) returnType:.Cell.Cell> [primary] - VALUE_PARAMETER name:value index:0 type:T of .Cell - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Cell modality:FINAL visibility:public superTypes:[kotlin.Any]' - PROPERTY name:value visibility:public modality:FINAL [var] - FIELD PROPERTY_BACKING_FIELD name:value type:T of .Cell visibility:private - EXPRESSION_BODY - GET_VAR 'value: T of .Cell declared in .Cell.' type=T of .Cell origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Cell.Cell>) returnType:T of .Cell - correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [var] - $this: VALUE_PARAMETER name: type:.Cell.Cell> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): T of .Cell declared in .Cell' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .Cell visibility:private' type=T of .Cell origin=null - receiver: GET_VAR ': .Cell.Cell> declared in .Cell.' type=.Cell.Cell> origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Cell.Cell>, :T of .Cell) returnType:kotlin.Unit - correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [var] - $this: VALUE_PARAMETER name: type:.Cell.Cell> - VALUE_PARAMETER name: index:0 type:T of .Cell - BLOCK_BODY - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .Cell visibility:private' type=kotlin.Unit origin=null - receiver: GET_VAR ': .Cell.Cell> declared in .Cell.' type=.Cell.Cell> origin=null - value: GET_VAR ': T of .Cell declared in .Cell.' type=T of .Cell 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 - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:Outer modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer.Outer> - TYPE_PARAMETER name:T1 index:0 variance: superTypes:[kotlin.Any?] - CONSTRUCTOR visibility:public <> () returnType:.Outer.Outer> [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Outer modality:FINAL visibility:public superTypes:[kotlin.Any]' - CLASS CLASS name:Inner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer.Inner.Outer.Inner, T1 of .Outer> - TYPE_PARAMETER name:T2 index:0 variance: superTypes:[kotlin.Any?] - CONSTRUCTOR visibility:public <> ($this:.Outer.Outer>) returnType:.Outer.Inner.Outer.Inner, T1 of .Outer> [primary] - $outer: VALUE_PARAMETER name: type:.Outer.Outer> - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Inner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any]' - FUN name:use visibility:public modality:FINAL <> ($this:.Outer.Inner.Outer.Inner, T1 of .Outer>, x1:T1 of .Outer, x2:T2 of .Outer.Inner) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.Outer.Inner.Outer.Inner, T1 of .Outer> - VALUE_PARAMETER name:x1 index:0 type:T1 of .Outer - VALUE_PARAMETER name:x2 index:1 type:T2 of .Outer.Inner - BLOCK_BODY - 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 - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - 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 - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/types/smartCastOnReceiverOfGenericType.kt b/compiler/testData/ir/irText/types/smartCastOnReceiverOfGenericType.kt index e0f25b39d5a..8638ac47750 100644 --- a/compiler/testData/ir/irText/types/smartCastOnReceiverOfGenericType.kt +++ b/compiler/testData/ir/irText/types/smartCastOnReceiverOfGenericType.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL fun testFunction(a: Any, b: Any) { a as MutableList b as String