diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/ConversionUtils.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/ConversionUtils.kt index f03870b7dd0..fd4667e5950 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/ConversionUtils.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/ConversionUtils.kt @@ -21,7 +21,6 @@ import org.jetbrains.kotlin.fir.references.FirThisReference import org.jetbrains.kotlin.fir.references.impl.FirPropertyFromParameterResolvedNamedReference import org.jetbrains.kotlin.fir.resolve.* import org.jetbrains.kotlin.fir.resolve.calls.SyntheticPropertySymbol -import org.jetbrains.kotlin.fir.resolve.inference.isBuiltinFunctionalType import org.jetbrains.kotlin.fir.resolve.providers.FirProvider import org.jetbrains.kotlin.fir.resolve.toSymbol import org.jetbrains.kotlin.fir.scopes.ProcessorAction @@ -383,7 +382,7 @@ private val nameToOperationConventionOrigin = mutableMapOf( OperatorNameConventions.RANGE_TO to IrStatementOrigin.RANGE ) -internal fun FirReference.statementOrigin(session: FirSession): IrStatementOrigin? { +internal fun FirReference.statementOrigin(): IrStatementOrigin? { return when (this) { is FirPropertyFromParameterResolvedNamedReference -> IrStatementOrigin.INITIALIZE_PROPERTY_FROM_PARAMETER is FirResolvedNamedReference -> when (val symbol = resolvedSymbol) { @@ -402,12 +401,6 @@ internal fun FirReference.statementOrigin(session: FirSession): IrStatementOrigi else -> null } - is FirVariableSymbol -> { - if ((symbol.fir as FirVariable).returnTypeRef.coneType.isBuiltinFunctionalType(session)) { - IrStatementOrigin.VARIABLE_AS_FUNCTION - } else - null - } else -> null } else -> null 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 32c5150ea21..192f8896ffa 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 @@ -50,6 +50,7 @@ import org.jetbrains.kotlin.lexer.KtTokens import org.jetbrains.kotlin.name.Name import org.jetbrains.kotlin.psi.KtBinaryExpression import org.jetbrains.kotlin.psi.KtForExpression +import org.jetbrains.kotlin.util.OperatorNameConventions class Fir2IrVisitor( private val converter: Fir2IrConverter, @@ -567,7 +568,18 @@ class Fir2IrVisitor( null -> null is FirResolvedQualifier -> callGenerator.convertToGetObject(expression, callableReferenceMode) is FirExpressionWithSmartcast -> convertToImplicitCastExpression(expression, calleeReference) - else -> convertToIrExpression(expression) + is FirFunctionCall, is FirThisReceiverExpression, is FirCallableReferenceAccess -> convertToIrExpression(expression) + else -> if (expression is FirQualifiedAccessExpression && expression.explicitReceiver == null) { + val variableAsFunctionMode = calleeReference is FirResolvedNamedReference && + calleeReference.name != OperatorNameConventions.INVOKE && + (calleeReference.resolvedSymbol as? FirCallableSymbol)?.callableId?.callableName == OperatorNameConventions.INVOKE + callGenerator.convertToIrCall( + expression, expression.typeRef, explicitReceiverExpression = null, + variableAsFunctionMode = variableAsFunctionMode + ) + } else { + convertToIrExpression(expression) + } } } diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/CallAndReferenceGenerator.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/CallAndReferenceGenerator.kt index c5664e43bd3..bbab2061bc0 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/CallAndReferenceGenerator.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/CallAndReferenceGenerator.kt @@ -159,7 +159,8 @@ class CallAndReferenceGenerator( qualifiedAccess: FirQualifiedAccess, typeRef: FirTypeRef, explicitReceiverExpression: IrExpression?, - annotationMode: Boolean = false + annotationMode: Boolean = false, + variableAsFunctionMode: Boolean = false ): IrExpression { try { val type = typeRef.toIrType() @@ -186,7 +187,7 @@ class CallAndReferenceGenerator( startOffset, endOffset, type, symbol, typeArgumentsCount = symbol.owner.typeParameters.size, valueArgumentsCount = symbol.owner.valueParameters.size, - origin = qualifiedAccess.calleeReference.statementOrigin(session), + origin = qualifiedAccess.calleeReference.statementOrigin(), superQualifierSymbol = dispatchReceiver.superQualifierSymbol(symbol) ) } @@ -227,7 +228,8 @@ class CallAndReferenceGenerator( ) is IrValueSymbol -> IrGetValueImpl( startOffset, endOffset, type, symbol, - origin = qualifiedAccess.calleeReference.statementOrigin(session) + origin = if (variableAsFunctionMode) IrStatementOrigin.VARIABLE_AS_FUNCTION + else qualifiedAccess.calleeReference.statementOrigin() ) is IrEnumEntrySymbol -> IrGetEnumValueImpl(startOffset, endOffset, type, symbol) else -> generateErrorCallExpression(startOffset, endOffset, qualifiedAccess.calleeReference, type) @@ -235,8 +237,10 @@ class CallAndReferenceGenerator( }.applyCallArguments(qualifiedAccess as? FirCall, annotationMode) .applyTypeArguments(qualifiedAccess).applyReceivers(qualifiedAccess, explicitReceiverExpression) } catch (e: Throwable) { - throw IllegalStateException("Error while translating ${qualifiedAccess.render()} " + - "from file ${conversionScope.containingFileIfAny()?.name ?: "???"} to BE IR", e) + throw IllegalStateException( + "Error while translating ${qualifiedAccess.render()} " + + "from file ${conversionScope.containingFileIfAny()?.name ?: "???"} to BE IR", e + ) } } diff --git a/compiler/testData/ir/irText/expressions/callableReferences/caoWithAdaptationForSam.fir.txt b/compiler/testData/ir/irText/expressions/callableReferences/caoWithAdaptationForSam.fir.txt index fe36f29fcfb..1c43268e701 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/caoWithAdaptationForSam.fir.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/caoWithAdaptationForSam.fir.txt @@ -110,10 +110,10 @@ FILE fqName: fileName:/caoWithAdaptationForSam.kt VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.reflect.KFunction1 [val] FUNCTION_REFERENCE 'public final fun withVararg (vararg xs: kotlin.Int): kotlin.Int declared in ' type=kotlin.reflect.KFunction1 origin=null reflectionTarget= ERROR_CALL 'Unresolved reference: #' type=kotlin.Unit - GET_VAR 'val tmp_1: kotlin.reflect.KFunction1 [val] declared in .test1' type=kotlin.reflect.KFunction1 origin=VARIABLE_AS_FUNCTION + GET_VAR 'val tmp_1: kotlin.reflect.KFunction1 [val] declared in .test1' type=kotlin.reflect.KFunction1 origin=null CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null $this: ERROR_CALL 'Unresolved reference: #' type=kotlin.Int - GET_VAR 'val tmp_1: kotlin.reflect.KFunction1 [val] declared in .test1' type=kotlin.reflect.KFunction1 origin=VARIABLE_AS_FUNCTION + GET_VAR 'val tmp_1: kotlin.reflect.KFunction1 [val] declared in .test1' type=kotlin.reflect.KFunction1 origin=null other: CONST Int type=kotlin.Int value=1 FUN name:test2 visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY @@ -123,10 +123,10 @@ FILE fqName: fileName:/caoWithAdaptationForSam.kt VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:kotlin.reflect.KFunction1 [val] FUNCTION_REFERENCE 'public final fun withVararg (vararg xs: kotlin.Int): kotlin.Int declared in ' type=kotlin.reflect.KFunction1 origin=null reflectionTarget= ERROR_CALL 'Unresolved reference: #' type=kotlin.Unit - GET_VAR 'val tmp_3: kotlin.reflect.KFunction1 [val] declared in .test2' type=kotlin.reflect.KFunction1 origin=VARIABLE_AS_FUNCTION + GET_VAR 'val tmp_3: kotlin.reflect.KFunction1 [val] declared in .test2' type=kotlin.reflect.KFunction1 origin=null CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null $this: ERROR_CALL 'Unresolved reference: #' type=kotlin.Int - GET_VAR 'val tmp_3: kotlin.reflect.KFunction1 [val] declared in .test2' type=kotlin.reflect.KFunction1 origin=VARIABLE_AS_FUNCTION + GET_VAR 'val tmp_3: kotlin.reflect.KFunction1 [val] declared in .test2' type=kotlin.reflect.KFunction1 origin=null other: CONST Int type=kotlin.Int value=1 FUN name:test3 visibility:public modality:FINAL <> (fn:kotlin.Function1) returnType:kotlin.Unit VALUE_PARAMETER name:fn index:0 type:kotlin.Function1 @@ -135,16 +135,16 @@ FILE fqName: fileName:/caoWithAdaptationForSam.kt VAR IR_TEMPORARY_VARIABLE name:tmp_4 type:.A [val] GET_OBJECT 'CLASS OBJECT name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.A VAR IR_TEMPORARY_VARIABLE name:tmp_5 type:kotlin.Function1 [val] - GET_VAR 'fn: kotlin.Function1 declared in .test3' type=kotlin.Function1 origin=VARIABLE_AS_FUNCTION + GET_VAR 'fn: kotlin.Function1 declared in .test3' type=kotlin.Function1 origin=null CALL 'public final fun set (i: .IFoo, newValue: kotlin.Int): kotlin.Unit [operator] declared in ' type=kotlin.Unit origin=null $receiver: GET_VAR 'val tmp_4: .A [val] declared in .test3' type=.A origin=null i: TYPE_OP type=.IFoo origin=SAM_CONVERSION typeOperand=.IFoo - GET_VAR 'val tmp_5: kotlin.Function1 [val] declared in .test3' type=kotlin.Function1 origin=VARIABLE_AS_FUNCTION + GET_VAR 'val tmp_5: kotlin.Function1 [val] declared in .test3' type=kotlin.Function1 origin=null newValue: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null $this: CALL 'public final fun get (i: .IFoo): kotlin.Int [operator] declared in ' type=kotlin.Int origin=null $receiver: GET_VAR 'val tmp_4: .A [val] declared in .test3' type=.A origin=null i: TYPE_OP type=.IFoo origin=SAM_CONVERSION typeOperand=.IFoo - GET_VAR 'val tmp_5: kotlin.Function1 [val] declared in .test3' type=kotlin.Function1 origin=VARIABLE_AS_FUNCTION + GET_VAR 'val tmp_5: kotlin.Function1 [val] declared in .test3' type=kotlin.Function1 origin=null other: CONST Int type=kotlin.Int value=1 FUN name:test4 visibility:public modality:FINAL <> (fn:kotlin.Function1) returnType:kotlin.Unit VALUE_PARAMETER name:fn index:0 type:kotlin.Function1 @@ -152,13 +152,13 @@ FILE fqName: fileName:/caoWithAdaptationForSam.kt WHEN type=kotlin.Unit origin=IF BRANCH if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=.IFoo - GET_VAR 'fn: kotlin.Function1 declared in .test4' type=kotlin.Function1 origin=VARIABLE_AS_FUNCTION + GET_VAR 'fn: kotlin.Function1 declared in .test4' type=kotlin.Function1 origin=null then: BLOCK type=kotlin.Unit origin=null VAR IR_TEMPORARY_VARIABLE name:tmp_6 type:.A [val] GET_OBJECT 'CLASS OBJECT name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.A VAR IR_TEMPORARY_VARIABLE name:tmp_7 type:.IFoo [val] TYPE_OP type=.IFoo origin=IMPLICIT_CAST typeOperand=.IFoo - GET_VAR 'fn: kotlin.Function1 declared in .test4' type=kotlin.Function1 origin=VARIABLE_AS_FUNCTION + GET_VAR 'fn: kotlin.Function1 declared in .test4' type=kotlin.Function1 origin=null CALL 'public final fun set (i: .IFoo, newValue: kotlin.Int): kotlin.Unit [operator] declared in ' type=kotlin.Unit origin=null $receiver: GET_VAR 'val tmp_6: .A [val] declared in .test4' type=.A origin=null i: GET_VAR 'val tmp_7: .IFoo [val] declared in .test4' type=.IFoo origin=null @@ -182,12 +182,12 @@ FILE fqName: fileName:/caoWithAdaptationForSam.kt CALL 'public final fun set (i: .IFoo, newValue: kotlin.Int): kotlin.Unit [operator] declared in ' type=kotlin.Unit origin=null $receiver: GET_VAR 'val tmp_8: .A [val] declared in .test5' type=.A origin=null i: TYPE_OP type=.IFoo origin=SAM_CONVERSION typeOperand=.IFoo - GET_VAR 'val tmp_9: kotlin.Function1 [val] declared in .test5' type=kotlin.Function1 origin=VARIABLE_AS_FUNCTION + GET_VAR 'val tmp_9: kotlin.Function1 [val] declared in .test5' type=kotlin.Function1 origin=null newValue: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null $this: CALL 'public final fun get (i: .IFoo): kotlin.Int [operator] declared in ' type=kotlin.Int origin=null $receiver: GET_VAR 'val tmp_8: .A [val] declared in .test5' type=.A origin=null i: TYPE_OP type=.IFoo origin=SAM_CONVERSION typeOperand=.IFoo - GET_VAR 'val tmp_9: kotlin.Function1 [val] declared in .test5' type=kotlin.Function1 origin=VARIABLE_AS_FUNCTION + GET_VAR 'val tmp_9: kotlin.Function1 [val] declared in .test5' type=kotlin.Function1 origin=null other: CONST Int type=kotlin.Int value=1 FUN name:test6 visibility:public modality:FINAL <> (a:kotlin.Any) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:kotlin.Any diff --git a/compiler/testData/ir/irText/expressions/funInterface/arrayAsVarargAfterSamArgument_fi.txt b/compiler/testData/ir/irText/expressions/funInterface/arrayAsVarargAfterSamArgument_fi.txt index f308ac1b394..1ba2beb0eec 100644 --- a/compiler/testData/ir/irText/expressions/funInterface/arrayAsVarargAfterSamArgument_fi.txt +++ b/compiler/testData/ir/irText/expressions/funInterface/arrayAsVarargAfterSamArgument_fi.txt @@ -52,12 +52,12 @@ FILE fqName: fileName:/arrayAsVarargAfterSamArgument_fi.kt GET_VAR 'arr: kotlin.Array declared in .test' type=kotlin.Array origin=null CALL 'public final fun foo1 (r: .IRunnable, vararg s: kotlin.String): kotlin.Unit declared in ' type=kotlin.Unit origin=null r: TYPE_OP type=.IRunnable origin=SAM_CONVERSION typeOperand=.IRunnable - GET_VAR 'fn: kotlin.Function0 declared in .test' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION + GET_VAR 'fn: kotlin.Function0 declared in .test' type=kotlin.Function0 origin=null s: VARARG type=kotlin.Array varargElementType=kotlin.String GET_VAR 's: kotlin.String declared in .test' type=kotlin.String origin=null CALL 'public final fun foo1 (r: .IRunnable, vararg s: kotlin.String): kotlin.Unit declared in ' type=kotlin.Unit origin=null r: TYPE_OP type=.IRunnable origin=SAM_CONVERSION typeOperand=.IRunnable - GET_VAR 'fn: kotlin.Function0 declared in .test' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION + GET_VAR 'fn: kotlin.Function0 declared in .test' type=kotlin.Function0 origin=null s: VARARG type=kotlin.Array varargElementType=kotlin.String SPREAD_ELEMENT GET_VAR 'arr: kotlin.Array declared in .test' type=kotlin.Array origin=null @@ -103,7 +103,7 @@ FILE fqName: fileName:/arrayAsVarargAfterSamArgument_fi.kt GET_VAR 'arr: kotlin.Array declared in .test' type=kotlin.Array origin=null CALL 'public final fun foo2 (r1: .IRunnable, r2: .IRunnable, vararg s: kotlin.String): kotlin.Unit declared in ' type=kotlin.Unit origin=null r1: TYPE_OP type=.IRunnable origin=SAM_CONVERSION typeOperand=.IRunnable - GET_VAR 'fn: kotlin.Function0 declared in .test' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION + GET_VAR 'fn: kotlin.Function0 declared in .test' type=kotlin.Function0 origin=null r2: TYPE_OP type=.IRunnable origin=SAM_CONVERSION typeOperand=.IRunnable FUN_EXPR type=kotlin.Function0 origin=LAMBDA FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.Unit @@ -114,7 +114,7 @@ FILE fqName: fileName:/arrayAsVarargAfterSamArgument_fi.kt GET_VAR 's: kotlin.String declared in .test' type=kotlin.String origin=null CALL 'public final fun foo2 (r1: .IRunnable, r2: .IRunnable, vararg s: kotlin.String): kotlin.Unit declared in ' type=kotlin.Unit origin=null r1: TYPE_OP type=.IRunnable origin=SAM_CONVERSION typeOperand=.IRunnable - GET_VAR 'fn: kotlin.Function0 declared in .test' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION + GET_VAR 'fn: kotlin.Function0 declared in .test' type=kotlin.Function0 origin=null r2: TYPE_OP type=.IRunnable origin=SAM_CONVERSION typeOperand=.IRunnable FUN_EXPR type=kotlin.Function0 origin=LAMBDA FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.Unit diff --git a/compiler/testData/ir/irText/expressions/funInterface/samConversionsWithSmartCasts.fir.txt b/compiler/testData/ir/irText/expressions/funInterface/samConversionsWithSmartCasts.fir.txt index 40e8934150e..86e5d5b4cdb 100644 --- a/compiler/testData/ir/irText/expressions/funInterface/samConversionsWithSmartCasts.fir.txt +++ b/compiler/testData/ir/irText/expressions/funInterface/samConversionsWithSmartCasts.fir.txt @@ -41,10 +41,10 @@ FILE fqName: fileName:/samConversionsWithSmartCasts.kt WHEN type=kotlin.Unit origin=IF BRANCH if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=.KRunnable - GET_VAR 'a: kotlin.Function0 declared in .test1' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION + GET_VAR 'a: kotlin.Function0 declared in .test1' type=kotlin.Function0 origin=null then: CALL 'public final fun run1 (r: .KRunnable): kotlin.Unit declared in ' type=kotlin.Unit origin=null r: TYPE_OP type=.KRunnable origin=IMPLICIT_CAST typeOperand=.KRunnable - GET_VAR 'a: kotlin.Function0 declared in .test1' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION + GET_VAR 'a: kotlin.Function0 declared in .test1' type=kotlin.Function0 origin=null FUN name:test2 visibility:public modality:FINAL <> (a:.KRunnable) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:.KRunnable BLOCK_BODY @@ -60,12 +60,12 @@ FILE fqName: fileName:/samConversionsWithSmartCasts.kt WHEN type=kotlin.Unit origin=IF BRANCH if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=.KRunnable - GET_VAR 'a: kotlin.Function0 declared in .test3' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION + GET_VAR 'a: kotlin.Function0 declared in .test3' type=kotlin.Function0 origin=null then: CALL 'public final fun run2 (r1: .KRunnable, r2: .KRunnable): kotlin.Unit declared in ' type=kotlin.Unit origin=null r1: TYPE_OP type=.KRunnable origin=IMPLICIT_CAST typeOperand=.KRunnable - GET_VAR 'a: kotlin.Function0 declared in .test3' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION + GET_VAR 'a: kotlin.Function0 declared in .test3' type=kotlin.Function0 origin=null r2: TYPE_OP type=.KRunnable origin=IMPLICIT_CAST typeOperand=.KRunnable - GET_VAR 'a: kotlin.Function0 declared in .test3' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION + GET_VAR 'a: kotlin.Function0 declared in .test3' type=kotlin.Function0 origin=null FUN name:test4 visibility:public modality:FINAL <> (a:kotlin.Function0, b:kotlin.Function0) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:kotlin.Function0 VALUE_PARAMETER name:b index:1 type:kotlin.Function0 @@ -73,12 +73,12 @@ FILE fqName: fileName:/samConversionsWithSmartCasts.kt WHEN type=kotlin.Unit origin=IF BRANCH if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=.KRunnable - GET_VAR 'a: kotlin.Function0 declared in .test4' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION + GET_VAR 'a: kotlin.Function0 declared in .test4' type=kotlin.Function0 origin=null then: CALL 'public final fun run2 (r1: .KRunnable, r2: .KRunnable): kotlin.Unit declared in ' type=kotlin.Unit origin=null r1: TYPE_OP type=.KRunnable origin=IMPLICIT_CAST typeOperand=.KRunnable - GET_VAR 'a: kotlin.Function0 declared in .test4' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION + GET_VAR 'a: kotlin.Function0 declared in .test4' type=kotlin.Function0 origin=null r2: TYPE_OP type=.KRunnable origin=SAM_CONVERSION typeOperand=.KRunnable - GET_VAR 'b: kotlin.Function0 declared in .test4' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION + GET_VAR 'b: kotlin.Function0 declared in .test4' type=kotlin.Function0 origin=null FUN name:test5 visibility:public modality:FINAL <> (a:kotlin.Any) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:kotlin.Any BLOCK_BODY @@ -121,7 +121,7 @@ FILE fqName: fileName:/samConversionsWithSmartCasts.kt r: TYPE_OP type=.KRunnable origin=SAM_CONVERSION typeOperand=.KRunnable CALL 'public final fun id (x: T of .id): T of .id declared in ' type=kotlin.Function0 origin=null : kotlin.Function0 - x: GET_VAR 'a: kotlin.Function0 declared in .test8' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION + x: GET_VAR 'a: kotlin.Function0 declared in .test8' type=kotlin.Function0 origin=null FUN name:test9 visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY CALL 'public final fun run1 (r: .KRunnable): kotlin.Unit declared in ' type=kotlin.Unit 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 cfc27feb8ef..748fa77c30f 100644 --- a/compiler/testData/ir/irText/expressions/sam/arrayAsVarargAfterSamArgument.fir.txt +++ b/compiler/testData/ir/irText/expressions/sam/arrayAsVarargAfterSamArgument.fir.txt @@ -23,12 +23,12 @@ FILE fqName: fileName:/arrayAsVarargAfterSamArgument.kt 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=VARIABLE_AS_FUNCTION + 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 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=VARIABLE_AS_FUNCTION + 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 @@ -38,12 +38,12 @@ FILE fqName: fileName:/arrayAsVarargAfterSamArgument.kt 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=VARIABLE_AS_FUNCTION + 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 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=VARIABLE_AS_FUNCTION + 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 diff --git a/compiler/testData/ir/irText/expressions/sam/samConstructors.fir.txt b/compiler/testData/ir/irText/expressions/sam/samConstructors.fir.txt index 9a16e29405b..76d3d8cba80 100644 --- a/compiler/testData/ir/irText/expressions/sam/samConstructors.fir.txt +++ b/compiler/testData/ir/irText/expressions/sam/samConstructors.fir.txt @@ -13,7 +13,7 @@ FILE fqName: fileName:/samConstructors.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test2 (a: kotlin.Function0): java.lang.Runnable declared in ' TYPE_OP type=java.lang.Runnable origin=SAM_CONVERSION typeOperand=java.lang.Runnable - GET_VAR 'a: kotlin.Function0 declared in .test2' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION + GET_VAR 'a: kotlin.Function0 declared in .test2' type=kotlin.Function0 origin=null FUN name:foo visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY FUN name:test3 visibility:public modality:FINAL <> () returnType:java.lang.Runnable diff --git a/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall.fir.txt b/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall.fir.txt index d69b6d9a33a..e609956c03f 100644 --- a/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall.fir.txt +++ b/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall.fir.txt @@ -6,7 +6,7 @@ FILE fqName: fileName:/samConversionInGenericConstructorCall.kt 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?>? - GET_VAR 'f: kotlin.Function1 declared in .test1' type=kotlin.Function1 origin=VARIABLE_AS_FUNCTION + GET_VAR 'f: kotlin.Function1 declared in .test1' type=kotlin.Function1 origin=null FUN name:test2 visibility:public modality:FINAL <> (x:kotlin.Any) returnType:kotlin.Unit VALUE_PARAMETER name:x index:0 type:kotlin.Any BLOCK_BODY 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 8e3a32f2a75..eddf1c4f215 100644 --- a/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall_NI.fir.txt +++ b/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall_NI.fir.txt @@ -9,9 +9,9 @@ FILE fqName: fileName:/samConversionInGenericConstructorCall_NI.kt $outer: 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?>? - GET_VAR 'f1: kotlin.Function1 declared in .test3' type=kotlin.Function1 origin=VARIABLE_AS_FUNCTION + GET_VAR 'f1: kotlin.Function1 declared in .test3' type=kotlin.Function1 origin=null jxy: TYPE_OP type=.J.C.D?>? origin=SAM_CONVERSION typeOperand=.J.C.D?>? - GET_VAR 'f2: kotlin.Function1 declared in .test3' type=kotlin.Function1 origin=VARIABLE_AS_FUNCTION + GET_VAR 'f2: kotlin.Function1 declared in .test3' type=kotlin.Function1 origin=null 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?] @@ -87,9 +87,9 @@ FILE fqName: fileName:/samConversionInGenericConstructorCall_NI.kt $outer: CONSTRUCTOR_CALL 'public constructor (j11: .J.Outer, T1 of .Outer>) [primary] declared in .Outer' type=.Outer origin=null : kotlin.String? j11: TYPE_OP type=.J.Outer, T1 of .Outer> origin=SAM_CONVERSION typeOperand=.J.Outer, T1 of .Outer> - GET_VAR 'f: kotlin.Function1 declared in .test4' type=kotlin.Function1 origin=VARIABLE_AS_FUNCTION + GET_VAR 'f: kotlin.Function1 declared in .test4' type=kotlin.Function1 origin=null j12: TYPE_OP type=.J.Outer.Inner> origin=SAM_CONVERSION typeOperand=.J.Outer.Inner> - GET_VAR 'g: kotlin.Function1 declared in .test4' type=kotlin.Function1 origin=VARIABLE_AS_FUNCTION + GET_VAR 'g: kotlin.Function1 declared in .test4' type=kotlin.Function1 origin=null FUN name:testGenericJavaCtor1 visibility:public modality:FINAL <> (f:kotlin.Function1) returnType:.G VALUE_PARAMETER name:f index:0 type:kotlin.Function1 BLOCK_BODY @@ -98,7 +98,7 @@ FILE fqName: fileName:/samConversionInGenericConstructorCall_NI.kt : kotlin.String? : kotlin.Int? x: TYPE_OP type=.J.G.?, TClass of .G?>? origin=SAM_CONVERSION typeOperand=.J.G.?, TClass of .G?>? - GET_VAR 'f: kotlin.Function1 declared in .testGenericJavaCtor1' type=kotlin.Function1 origin=VARIABLE_AS_FUNCTION + GET_VAR 'f: kotlin.Function1 declared in .testGenericJavaCtor1' type=kotlin.Function1 origin=null FUN name:testGenericJavaCtor2 visibility:public modality:FINAL <> (x:kotlin.Any) returnType:kotlin.Unit VALUE_PARAMETER name:x index:0 type:kotlin.Any BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/sam/samConversionToGeneric.fir.txt b/compiler/testData/ir/irText/expressions/sam/samConversionToGeneric.fir.txt index 7589d9b55bf..e956025229a 100644 --- a/compiler/testData/ir/irText/expressions/sam/samConversionToGeneric.fir.txt +++ b/compiler/testData/ir/irText/expressions/sam/samConversionToGeneric.fir.txt @@ -59,7 +59,7 @@ FILE fqName: fileName:/samConversionToGeneric.kt CALL 'public open fun bar (j: .J.H.bar?>?): kotlin.Unit declared in .H' type=kotlin.Unit origin=null : T of .test6? j: TYPE_OP type=.J.H.bar?>? origin=SAM_CONVERSION typeOperand=.J.H.bar?>? - GET_VAR 'a: kotlin.Function1.test6, T of .test6> declared in .test6' type=kotlin.Function1.test6, T of .test6> origin=VARIABLE_AS_FUNCTION + GET_VAR 'a: kotlin.Function1.test6, T of .test6> declared in .test6' type=kotlin.Function1.test6, T of .test6> origin=null FUN name:test7 visibility:public modality:FINAL (a:kotlin.Any) returnType:kotlin.Unit TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] VALUE_PARAMETER name:a index:0 type:kotlin.Any @@ -77,18 +77,18 @@ FILE fqName: fileName:/samConversionToGeneric.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test8 (efn: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1): .J declared in ' TYPE_OP type=.J origin=SAM_CONVERSION typeOperand=.J - GET_VAR 'efn: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 declared in .test8' type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 origin=VARIABLE_AS_FUNCTION + GET_VAR 'efn: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 declared in .test8' type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 origin=null FUN name:test9 visibility:public modality:FINAL <> (efn:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1) returnType:kotlin.Unit VALUE_PARAMETER name:efn index:0 type:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 BLOCK_BODY 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?>? - GET_VAR 'efn: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 declared in .test9' type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 origin=VARIABLE_AS_FUNCTION + GET_VAR 'efn: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 declared in .test9' type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 origin=null FUN name:test10 visibility:public modality:FINAL <> (fn:kotlin.Function1) returnType:kotlin.Unit VALUE_PARAMETER name:fn index:0 type:kotlin.Function1 BLOCK_BODY CALL 'public open fun bar2x (j2x: .J2X.H.bar2x?>?): kotlin.Unit declared in .H' type=kotlin.Unit origin=null : kotlin.Int? j2x: TYPE_OP type=.J2X.H.bar2x?>? origin=SAM_CONVERSION typeOperand=.J2X.H.bar2x?>? - GET_VAR 'fn: kotlin.Function1 declared in .test10' type=kotlin.Function1 origin=VARIABLE_AS_FUNCTION + GET_VAR 'fn: kotlin.Function1 declared in .test10' type=kotlin.Function1 origin=null diff --git a/compiler/testData/ir/irText/expressions/sam/samConversions.fir.txt b/compiler/testData/ir/irText/expressions/sam/samConversions.fir.txt index 34c1625394f..f73745b3804 100644 --- a/compiler/testData/ir/irText/expressions/sam/samConversions.fir.txt +++ b/compiler/testData/ir/irText/expressions/sam/samConversions.fir.txt @@ -33,9 +33,9 @@ FILE fqName: fileName:/samConversions.kt CALL 'public open fun run2 (r1: java.lang.Runnable?, r2: java.lang.Runnable?): kotlin.Unit declared in .J' type=kotlin.Unit origin=null $this: GET_VAR ': .J declared in .test3' type=.J origin=null r1: TYPE_OP type=java.lang.Runnable? origin=SAM_CONVERSION typeOperand=java.lang.Runnable? - GET_VAR 'a: kotlin.Function0 declared in .test3' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION + GET_VAR 'a: kotlin.Function0 declared in .test3' type=kotlin.Function0 origin=null r2: TYPE_OP type=java.lang.Runnable? origin=SAM_CONVERSION typeOperand=java.lang.Runnable? - GET_VAR 'a: kotlin.Function0 declared in .test3' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION + GET_VAR 'a: kotlin.Function0 declared in .test3' type=kotlin.Function0 origin=null FUN name:test4 visibility:public modality:FINAL <> ($receiver:.J, a:kotlin.Function0, b:kotlin.Function0, flag:kotlin.Boolean) returnType:kotlin.Unit $receiver: VALUE_PARAMETER name: type:.J VALUE_PARAMETER name:a index:0 type:kotlin.Function0 @@ -48,7 +48,7 @@ FILE fqName: fileName:/samConversions.kt WHEN type=kotlin.Function0 origin=IF BRANCH if: GET_VAR 'flag: kotlin.Boolean declared in .test4' type=kotlin.Boolean origin=null - then: GET_VAR 'a: kotlin.Function0 declared in .test4' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION + then: GET_VAR 'a: kotlin.Function0 declared in .test4' type=kotlin.Function0 origin=null BRANCH if: CONST Boolean type=kotlin.Boolean value=true - then: GET_VAR 'b: kotlin.Function0 declared in .test4' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION + then: GET_VAR 'b: kotlin.Function0 declared in .test4' type=kotlin.Function0 origin=null diff --git a/compiler/testData/ir/irText/expressions/sam/samConversionsWithSmartCasts.fir.txt b/compiler/testData/ir/irText/expressions/sam/samConversionsWithSmartCasts.fir.txt index f5d9ee60e16..40cc1ac952e 100644 --- a/compiler/testData/ir/irText/expressions/sam/samConversionsWithSmartCasts.fir.txt +++ b/compiler/testData/ir/irText/expressions/sam/samConversionsWithSmartCasts.fir.txt @@ -5,34 +5,34 @@ FILE fqName: fileName:/samConversionsWithSmartCasts.kt WHEN type=kotlin.Unit origin=IF BRANCH if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=java.lang.Runnable - GET_VAR 'a: kotlin.Function0 declared in .test1' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION + GET_VAR 'a: kotlin.Function0 declared in .test1' type=kotlin.Function0 origin=null then: CALL 'public open fun runStatic (r: java.lang.Runnable?): kotlin.Unit declared in .J' type=kotlin.Unit origin=null r: TYPE_OP type=java.lang.Runnable origin=IMPLICIT_CAST typeOperand=java.lang.Runnable - GET_VAR 'a: kotlin.Function0 declared in .test1' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION + GET_VAR 'a: kotlin.Function0 declared in .test1' type=kotlin.Function0 origin=null FUN name:test2 visibility:public modality:FINAL <> (a:kotlin.Function0) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:kotlin.Function0 BLOCK_BODY WHEN type=kotlin.Unit origin=IF BRANCH if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=java.lang.Runnable - GET_VAR 'a: kotlin.Function0 declared in .test2' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION + GET_VAR 'a: kotlin.Function0 declared in .test2' type=kotlin.Function0 origin=null then: CALL 'public open fun run1 (r: java.lang.Runnable?): kotlin.Unit 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 - GET_VAR 'a: kotlin.Function0 declared in .test2' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION + GET_VAR 'a: kotlin.Function0 declared in .test2' type=kotlin.Function0 origin=null FUN name:test3 visibility:public modality:FINAL <> (a:kotlin.Function0) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:kotlin.Function0 BLOCK_BODY WHEN type=kotlin.Unit origin=IF BRANCH if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=java.lang.Runnable - GET_VAR 'a: kotlin.Function0 declared in .test3' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION + GET_VAR 'a: kotlin.Function0 declared in .test3' type=kotlin.Function0 origin=null then: CALL 'public open fun run2 (r1: java.lang.Runnable?, r2: java.lang.Runnable?): kotlin.Unit declared in .J' type=kotlin.Unit origin=null $this: CONSTRUCTOR_CALL 'public constructor () [primary] declared in .J' type=.J origin=null r1: TYPE_OP type=java.lang.Runnable origin=IMPLICIT_CAST typeOperand=java.lang.Runnable - GET_VAR 'a: kotlin.Function0 declared in .test3' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION + GET_VAR 'a: kotlin.Function0 declared in .test3' type=kotlin.Function0 origin=null r2: TYPE_OP type=java.lang.Runnable origin=IMPLICIT_CAST typeOperand=java.lang.Runnable - GET_VAR 'a: kotlin.Function0 declared in .test3' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION + GET_VAR 'a: kotlin.Function0 declared in .test3' type=kotlin.Function0 origin=null FUN name:test4 visibility:public modality:FINAL <> (a:kotlin.Function0, b:kotlin.Function0) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:kotlin.Function0 VALUE_PARAMETER name:b index:1 type:kotlin.Function0 @@ -40,13 +40,13 @@ FILE fqName: fileName:/samConversionsWithSmartCasts.kt WHEN type=kotlin.Unit origin=IF BRANCH if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=java.lang.Runnable - GET_VAR 'a: kotlin.Function0 declared in .test4' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION + GET_VAR 'a: kotlin.Function0 declared in .test4' type=kotlin.Function0 origin=null then: CALL 'public open fun run2 (r1: java.lang.Runnable?, r2: java.lang.Runnable?): kotlin.Unit declared in .J' type=kotlin.Unit origin=null $this: CONSTRUCTOR_CALL 'public constructor () [primary] declared in .J' type=.J origin=null r1: TYPE_OP type=java.lang.Runnable origin=IMPLICIT_CAST typeOperand=java.lang.Runnable - GET_VAR 'a: kotlin.Function0 declared in .test4' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION + GET_VAR 'a: kotlin.Function0 declared in .test4' type=kotlin.Function0 origin=null r2: TYPE_OP type=java.lang.Runnable? origin=SAM_CONVERSION typeOperand=java.lang.Runnable? - GET_VAR 'b: kotlin.Function0 declared in .test4' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION + GET_VAR 'b: kotlin.Function0 declared in .test4' type=kotlin.Function0 origin=null FUN name:test5 visibility:public modality:FINAL <> (a:kotlin.Any) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:kotlin.Any BLOCK_BODY @@ -90,17 +90,17 @@ FILE fqName: fileName:/samConversionsWithSmartCasts.kt BLOCK_BODY 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=VARIABLE_AS_FUNCTION + 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=VARIABLE_AS_FUNCTION + GET_VAR 'a: kotlin.Function1 declared in .test7' type=kotlin.Function1 origin=null FUN name:test8 visibility:public modality:FINAL <> (a:kotlin.Function0) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:kotlin.Function0 BLOCK_BODY ERROR_CALL 'Unresolved reference: #' type=kotlin.Unit CALL 'public open fun id (x: T of .J.id?): T of .J.id? declared in .J' type=kotlin.Function0? origin=null : kotlin.Function0? - x: GET_VAR 'a: kotlin.Function0 declared in .test8' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION + x: GET_VAR 'a: kotlin.Function0 declared in .test8' type=kotlin.Function0 origin=null FUN name:test9 visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY CALL 'public open fun run1 (r: java.lang.Runnable?): kotlin.Unit declared in .J' type=kotlin.Unit origin=null diff --git a/compiler/testData/ir/irText/expressions/suspendConversionOnArbitraryExpression.fir.txt b/compiler/testData/ir/irText/expressions/suspendConversionOnArbitraryExpression.fir.txt index 52c0cdf9b09..3b4ee75964b 100644 --- a/compiler/testData/ir/irText/expressions/suspendConversionOnArbitraryExpression.fir.txt +++ b/compiler/testData/ir/irText/expressions/suspendConversionOnArbitraryExpression.fir.txt @@ -30,7 +30,7 @@ FILE fqName: fileName:/suspendConversionOnArbitraryExpression.kt CALL 'public final fun useSuspend (sfn: kotlin.coroutines.SuspendFunction0): kotlin.Unit declared in ' type=kotlin.Unit origin=null sfn: BLOCK type=kotlin.coroutines.SuspendFunction0 origin=SUSPEND_CONVERSION VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.Function0 [val] - GET_VAR 'fn: kotlin.Function0 declared in .testSimple' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION + GET_VAR 'fn: kotlin.Function0 declared in .testSimple' type=kotlin.Function0 origin=null FUN_EXPR type=kotlin.coroutines.SuspendFunction0 origin=SUSPEND_CONVERSION FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion visibility:local modality:FINAL <> () returnType:kotlin.Unit [suspend] BLOCK_BODY @@ -53,7 +53,7 @@ FILE fqName: fileName:/suspendConversionOnArbitraryExpression.kt CALL 'public final fun useSuspendExt (sfn: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1): kotlin.Unit declared in ' type=kotlin.Unit origin=null sfn: BLOCK type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1 origin=SUSPEND_CONVERSION VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 [val] - GET_VAR 'fn: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 declared in .testExtAsExt' type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 origin=VARIABLE_AS_FUNCTION + GET_VAR 'fn: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 declared in .testExtAsExt' type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 origin=null FUN_EXPR type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1 origin=SUSPEND_CONVERSION FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion visibility:local modality:FINAL <> (p0:kotlin.Int) returnType:kotlin.Unit [suspend] VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:p0 index:0 type:kotlin.Int @@ -67,7 +67,7 @@ FILE fqName: fileName:/suspendConversionOnArbitraryExpression.kt CALL 'public final fun useSuspendArg (sfn: kotlin.coroutines.SuspendFunction1): kotlin.Unit declared in ' type=kotlin.Unit origin=null sfn: BLOCK type=kotlin.coroutines.SuspendFunction1 origin=SUSPEND_CONVERSION VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 [val] - GET_VAR 'fn: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 declared in .testExtAsSimple' type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 origin=VARIABLE_AS_FUNCTION + GET_VAR 'fn: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 declared in .testExtAsSimple' type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 origin=null FUN_EXPR type=kotlin.coroutines.SuspendFunction1 origin=SUSPEND_CONVERSION FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion visibility:local modality:FINAL <> (p0:kotlin.Int) returnType:kotlin.Unit [suspend] VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:p0 index:0 type:kotlin.Int @@ -81,7 +81,7 @@ FILE fqName: fileName:/suspendConversionOnArbitraryExpression.kt CALL 'public final fun useSuspendExt (sfn: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1): kotlin.Unit declared in ' type=kotlin.Unit origin=null sfn: BLOCK type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1 origin=SUSPEND_CONVERSION VAR IR_TEMPORARY_VARIABLE name:tmp_4 type:kotlin.Function1 [val] - GET_VAR 'fn: kotlin.Function1 declared in .testSimpleAsExt' type=kotlin.Function1 origin=VARIABLE_AS_FUNCTION + GET_VAR 'fn: kotlin.Function1 declared in .testSimpleAsExt' type=kotlin.Function1 origin=null FUN_EXPR type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1 origin=SUSPEND_CONVERSION FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion visibility:local modality:FINAL <> (p0:kotlin.Int) returnType:kotlin.Unit [suspend] VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:p0 index:0 type:kotlin.Int @@ -96,7 +96,7 @@ FILE fqName: fileName:/suspendConversionOnArbitraryExpression.kt : kotlin.Int sfn: BLOCK type=kotlin.coroutines.SuspendFunction1.useSuspendArgT, kotlin.Unit> origin=SUSPEND_CONVERSION VAR IR_TEMPORARY_VARIABLE name:tmp_5 type:kotlin.Function1 [val] - GET_VAR 'fn: kotlin.Function1 declared in .testSimpleAsSimpleT' type=kotlin.Function1 origin=VARIABLE_AS_FUNCTION + GET_VAR 'fn: kotlin.Function1 declared in .testSimpleAsSimpleT' type=kotlin.Function1 origin=null FUN_EXPR type=kotlin.coroutines.SuspendFunction1.useSuspendArgT, kotlin.Unit> origin=SUSPEND_CONVERSION FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion visibility:local modality:FINAL <> (p0:T of .useSuspendArgT) returnType:kotlin.Unit [suspend] VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:p0 index:0 type:T of .useSuspendArgT @@ -111,7 +111,7 @@ FILE fqName: fileName:/suspendConversionOnArbitraryExpression.kt : kotlin.Int sfn: BLOCK type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1.useSuspendExtT, kotlin.Unit> origin=SUSPEND_CONVERSION VAR IR_TEMPORARY_VARIABLE name:tmp_6 type:kotlin.Function1 [val] - GET_VAR 'fn: kotlin.Function1 declared in .testSimpleAsExtT' type=kotlin.Function1 origin=VARIABLE_AS_FUNCTION + GET_VAR 'fn: kotlin.Function1 declared in .testSimpleAsExtT' type=kotlin.Function1 origin=null FUN_EXPR type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1.useSuspendExtT, kotlin.Unit> origin=SUSPEND_CONVERSION FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion visibility:local modality:FINAL <> (p0:T of .useSuspendExtT) returnType:kotlin.Unit [suspend] VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:p0 index:0 type:T of .useSuspendExtT @@ -126,7 +126,7 @@ FILE fqName: fileName:/suspendConversionOnArbitraryExpression.kt : kotlin.Int sfn: BLOCK type=kotlin.coroutines.SuspendFunction1.useSuspendArgT, kotlin.Unit> origin=SUSPEND_CONVERSION VAR IR_TEMPORARY_VARIABLE name:tmp_7 type:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 [val] - GET_VAR 'fn: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 declared in .testExtAsSimpleT' type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 origin=VARIABLE_AS_FUNCTION + GET_VAR 'fn: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 declared in .testExtAsSimpleT' type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 origin=null FUN_EXPR type=kotlin.coroutines.SuspendFunction1.useSuspendArgT, kotlin.Unit> origin=SUSPEND_CONVERSION FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion visibility:local modality:FINAL <> (p0:T of .useSuspendArgT) returnType:kotlin.Unit [suspend] VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:p0 index:0 type:T of .useSuspendArgT @@ -141,7 +141,7 @@ FILE fqName: fileName:/suspendConversionOnArbitraryExpression.kt : kotlin.Int sfn: BLOCK type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1.useSuspendExtT, kotlin.Unit> origin=SUSPEND_CONVERSION VAR IR_TEMPORARY_VARIABLE name:tmp_8 type:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 [val] - GET_VAR 'fn: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 declared in .testExtAsExtT' type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 origin=VARIABLE_AS_FUNCTION + GET_VAR 'fn: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 declared in .testExtAsExtT' type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 origin=null FUN_EXPR type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1.useSuspendExtT, kotlin.Unit> origin=SUSPEND_CONVERSION FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion visibility:local modality:FINAL <> (p0:T of .useSuspendExtT) returnType:kotlin.Unit [suspend] VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:p0 index:0 type:T of .useSuspendExtT @@ -157,7 +157,7 @@ FILE fqName: fileName:/suspendConversionOnArbitraryExpression.kt : S of .testSimpleSAsSimpleT sfn: BLOCK type=kotlin.coroutines.SuspendFunction1.useSuspendArgT, kotlin.Unit> origin=SUSPEND_CONVERSION VAR IR_TEMPORARY_VARIABLE name:tmp_9 type:kotlin.Function1.testSimpleSAsSimpleT, kotlin.Unit> [val] - GET_VAR 'fn: kotlin.Function1.testSimpleSAsSimpleT, kotlin.Unit> declared in .testSimpleSAsSimpleT' type=kotlin.Function1.testSimpleSAsSimpleT, kotlin.Unit> origin=VARIABLE_AS_FUNCTION + GET_VAR 'fn: kotlin.Function1.testSimpleSAsSimpleT, kotlin.Unit> declared in .testSimpleSAsSimpleT' type=kotlin.Function1.testSimpleSAsSimpleT, kotlin.Unit> origin=null FUN_EXPR type=kotlin.coroutines.SuspendFunction1.useSuspendArgT, kotlin.Unit> origin=SUSPEND_CONVERSION FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion visibility:local modality:FINAL <> (p0:T of .useSuspendArgT) returnType:kotlin.Unit [suspend] VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:p0 index:0 type:T of .useSuspendArgT @@ -173,7 +173,7 @@ FILE fqName: fileName:/suspendConversionOnArbitraryExpression.kt : S of .testSimpleSAsExtT sfn: BLOCK type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1.useSuspendExtT, kotlin.Unit> origin=SUSPEND_CONVERSION VAR IR_TEMPORARY_VARIABLE name:tmp_10 type:kotlin.Function1.testSimpleSAsExtT, kotlin.Unit> [val] - GET_VAR 'fn: kotlin.Function1.testSimpleSAsExtT, kotlin.Unit> declared in .testSimpleSAsExtT' type=kotlin.Function1.testSimpleSAsExtT, kotlin.Unit> origin=VARIABLE_AS_FUNCTION + GET_VAR 'fn: kotlin.Function1.testSimpleSAsExtT, kotlin.Unit> declared in .testSimpleSAsExtT' type=kotlin.Function1.testSimpleSAsExtT, kotlin.Unit> origin=null FUN_EXPR type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1.useSuspendExtT, kotlin.Unit> origin=SUSPEND_CONVERSION FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion visibility:local modality:FINAL <> (p0:T of .useSuspendExtT) returnType:kotlin.Unit [suspend] VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:p0 index:0 type:T of .useSuspendExtT @@ -189,7 +189,7 @@ FILE fqName: fileName:/suspendConversionOnArbitraryExpression.kt : S of .testExtSAsSimpleT sfn: BLOCK type=kotlin.coroutines.SuspendFunction1.useSuspendArgT, kotlin.Unit> origin=SUSPEND_CONVERSION VAR IR_TEMPORARY_VARIABLE name:tmp_11 type:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1.testExtSAsSimpleT, kotlin.Unit> [val] - GET_VAR 'fn: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1.testExtSAsSimpleT, kotlin.Unit> declared in .testExtSAsSimpleT' type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1.testExtSAsSimpleT, kotlin.Unit> origin=VARIABLE_AS_FUNCTION + GET_VAR 'fn: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1.testExtSAsSimpleT, kotlin.Unit> declared in .testExtSAsSimpleT' type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1.testExtSAsSimpleT, kotlin.Unit> origin=null FUN_EXPR type=kotlin.coroutines.SuspendFunction1.useSuspendArgT, kotlin.Unit> origin=SUSPEND_CONVERSION FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion visibility:local modality:FINAL <> (p0:T of .useSuspendArgT) returnType:kotlin.Unit [suspend] VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:p0 index:0 type:T of .useSuspendArgT @@ -205,7 +205,7 @@ FILE fqName: fileName:/suspendConversionOnArbitraryExpression.kt : S of .testExtSAsExtT sfn: BLOCK type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1.useSuspendExtT, kotlin.Unit> origin=SUSPEND_CONVERSION VAR IR_TEMPORARY_VARIABLE name:tmp_12 type:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1.testExtSAsExtT, kotlin.Unit> [val] - GET_VAR 'fn: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1.testExtSAsExtT, kotlin.Unit> declared in .testExtSAsExtT' type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1.testExtSAsExtT, kotlin.Unit> origin=VARIABLE_AS_FUNCTION + GET_VAR 'fn: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1.testExtSAsExtT, kotlin.Unit> declared in .testExtSAsExtT' type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1.testExtSAsExtT, kotlin.Unit> origin=null FUN_EXPR type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1.useSuspendExtT, kotlin.Unit> origin=SUSPEND_CONVERSION FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion visibility:local modality:FINAL <> (p0:T of .useSuspendExtT) returnType:kotlin.Unit [suspend] VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:p0 index:0 type:T of .useSuspendExtT @@ -252,20 +252,20 @@ FILE fqName: fileName:/suspendConversionOnArbitraryExpression.kt BLOCK_BODY 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=VARIABLE_AS_FUNCTION + 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=VARIABLE_AS_FUNCTION + GET_VAR 'a: kotlin.Function0 declared in .testSmartCastVsSuspendConversion' type=kotlin.Function0 origin=null FUN name:testSmartCastOnVarVsSuspendConversion visibility:public modality:FINAL <> (a:kotlin.Function0) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:kotlin.Function0 BLOCK_BODY VAR name:b type:kotlin.Function0 [var] - GET_VAR 'a: kotlin.Function0 declared in .testSmartCastOnVarVsSuspendConversion' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION + GET_VAR 'a: kotlin.Function0 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=VARIABLE_AS_FUNCTION + 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=VARIABLE_AS_FUNCTION + 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 TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Function0; kotlin.coroutines.SuspendFunction0] VALUE_PARAMETER name:x index:0 type:T of .testIntersectionVsSuspendConversion diff --git a/compiler/testData/ir/irText/types/castsInsideCoroutineInference.fir.txt b/compiler/testData/ir/irText/types/castsInsideCoroutineInference.fir.txt index 5870d75d9da..1da9b222f7e 100644 --- a/compiler/testData/ir/irText/types/castsInsideCoroutineInference.fir.txt +++ b/compiler/testData/ir/irText/types/castsInsideCoroutineInference.fir.txt @@ -45,7 +45,7 @@ FILE fqName: fileName:/castsInsideCoroutineInference.kt CALL 'public final fun invokeSafely (action: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.FlowCollector.invokeSafely>, kotlin.Throwable?, kotlin.Unit>): kotlin.Unit [suspend] declared in ' type=kotlin.Unit origin=null : T of .onCompletion $receiver: GET_VAR 'val safeCollector: .SafeCollector [val] declared in .onCompletion.' type=.SafeCollector origin=null - action: GET_VAR 'action: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.FlowCollector.onCompletion>, kotlin.Throwable?, kotlin.Unit> declared in .onCompletion' type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.FlowCollector.onCompletion>, kotlin.Throwable?, kotlin.Unit> origin=VARIABLE_AS_FUNCTION + action: GET_VAR 'action: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.FlowCollector.onCompletion>, kotlin.Throwable?, kotlin.Unit> declared in .onCompletion' type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.FlowCollector.onCompletion>, kotlin.Throwable?, kotlin.Unit> origin=null FUN name:invokeSafely visibility:public modality:FINAL ($receiver:.FlowCollector.invokeSafely>, action:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.FlowCollector.invokeSafely>, kotlin.Throwable?, kotlin.Unit>) returnType:kotlin.Unit [suspend] TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] $receiver: VALUE_PARAMETER name: type:.FlowCollector.invokeSafely>