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 cb37d83c8bd..9b778371d07 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 @@ -25,6 +25,8 @@ import org.jetbrains.kotlin.fir.resolve.fullyExpandedType import org.jetbrains.kotlin.fir.resolve.inference.inferenceComponents import org.jetbrains.kotlin.fir.resolve.inference.isBuiltinFunctionalType import org.jetbrains.kotlin.fir.resolve.inference.isKMutableProperty +import org.jetbrains.kotlin.fir.resolve.substitution.ConeSubstitutor +import org.jetbrains.kotlin.fir.resolve.substitution.ConeSubstitutorByMap import org.jetbrains.kotlin.fir.resolve.toSymbol import org.jetbrains.kotlin.fir.scopes.unsubstitutedScope import org.jetbrains.kotlin.fir.symbols.impl.* @@ -52,10 +54,10 @@ class CallAndReferenceGenerator( private val adapterGenerator = AdapterGenerator(components, conversionScope) private val samResolver = FirSamResolverImpl(session, scopeSession) - private fun FirTypeRef.toIrType(conversionTypeContext: ConversionTypeContext = ConversionTypeContext.DEFAULT): IrType = - with(typeConverter) { toIrType(conversionTypeContext) } + private fun FirTypeRef.toIrType(): IrType = with(typeConverter) { toIrType() } - private fun ConeKotlinType.toIrType(): IrType = with(typeConverter) { toIrType() } + private fun ConeKotlinType.toIrType(conversionTypeContext: ConversionTypeContext = ConversionTypeContext.DEFAULT): IrType = + with(typeConverter) { toIrType(conversionTypeContext) } fun convertToIrCallableReference( callableReferenceAccess: FirCallableReferenceAccess, @@ -439,6 +441,17 @@ class CallAndReferenceGenerator( } } + private fun FirFunctionCall.buildSubstitutorByCalledFunction(function: FirFunction<*>?): ConeSubstitutor? { + if (function == null) return null + val map = mutableMapOf() + for ((index, typeParameter) in function.typeParameters.withIndex()) { + val typeProjection = typeArguments.getOrNull(index) as? FirTypeProjectionWithVariance ?: continue + val type = typeProjection.typeRef.coneTypeSafe() ?: continue + map[typeParameter.symbol] = type + } + return ConeSubstitutorByMap(map) + } + internal fun IrExpression.applyCallArguments(call: FirCall?, annotationMode: Boolean): IrExpression { if (call == null) return this return when (this) { @@ -461,14 +474,15 @@ class CallAndReferenceGenerator( } val valueParameters = function?.valueParameters val argumentMapping = call.argumentMapping + val substitutor = (call as? FirFunctionCall)?.buildSubstitutorByCalledFunction(function) ?: ConeSubstitutor.Empty if (argumentMapping != null && (annotationMode || argumentMapping.isNotEmpty())) { if (valueParameters != null) { - return applyArgumentsWithReorderingIfNeeded(argumentMapping, valueParameters, annotationMode) + return applyArgumentsWithReorderingIfNeeded(argumentMapping, valueParameters, substitutor, annotationMode) } } for ((index, argument) in call.arguments.withIndex()) { val valueParameter = valueParameters?.get(index) - val argumentExpression = convertArgument(argument, valueParameter) + val argumentExpression = convertArgument(argument, valueParameter, substitutor) putValueArgument(index, argumentExpression) } } @@ -496,6 +510,7 @@ class CallAndReferenceGenerator( private fun IrMemberAccessExpression<*>.applyArgumentsWithReorderingIfNeeded( argumentMapping: LinkedHashMap, valueParameters: List, + substitutor: ConeSubstitutor, annotationMode: Boolean ): IrExpression { // Assuming compile-time constants only inside annotation, we don't need a block to reorder arguments to preserve semantics. @@ -506,7 +521,7 @@ class CallAndReferenceGenerator( return IrBlockImpl(startOffset, endOffset, type, IrStatementOrigin.ARGUMENTS_REORDERING_FOR_CALL).apply { for ((argument, parameter) in argumentMapping) { val parameterIndex = valueParameters.indexOf(parameter) - val irArgument = convertArgument(argument, parameter) + val irArgument = convertArgument(argument, parameter, substitutor) if (irArgument.hasNoSideEffects()) { putValueArgument(parameterIndex, irArgument) } else { @@ -521,7 +536,7 @@ class CallAndReferenceGenerator( } } else { for ((argument, parameter) in argumentMapping) { - val argumentExpression = convertArgument(argument, parameter, annotationMode) + val argumentExpression = convertArgument(argument, parameter, substitutor, annotationMode) putValueArgument(valueParameters.indexOf(parameter), argumentExpression) } if (annotationMode) { @@ -562,6 +577,7 @@ class CallAndReferenceGenerator( private fun convertArgument( argument: FirExpression, parameter: FirValueParameter?, + substitutor: ConeSubstitutor, annotationMode: Boolean = false ): IrExpression { var irArgument = visitor.convertToIrExpression(argument, annotationMode) @@ -574,7 +590,7 @@ class CallAndReferenceGenerator( if (parameter?.returnTypeRef is FirResolvedTypeRef) { // Java type case (from annotations) irArgument = irArgument.applySuspendConversionIfNeeded(argument, parameter) - irArgument = irArgument.applySamConversionIfNeeded(argument, parameter) + irArgument = irArgument.applySamConversionIfNeeded(argument, parameter, substitutor) } } return irArgument.applyAssigningArrayElementsToVarargInNamedForm(argument, parameter) @@ -583,6 +599,7 @@ class CallAndReferenceGenerator( private fun IrExpression.applySamConversionIfNeeded( argument: FirExpression, parameter: FirValueParameter?, + substitutor: ConeSubstitutor, shouldUnwrapVarargType: Boolean = false ): IrExpression { if (parameter == null) { @@ -600,7 +617,7 @@ class CallAndReferenceGenerator( if (irVarargElement is IrExpression) { val firVarargArgument = argumentMapping[irVarargElement] ?: error("Can't find the original FirExpression for ${irVarargElement.render()}") - irVarargElement.applySamConversionIfNeeded(firVarargArgument, parameter, shouldUnwrapVarargType = true) + irVarargElement.applySamConversionIfNeeded(firVarargArgument, parameter, substitutor, shouldUnwrapVarargType = true) } else irVarargElement } @@ -609,7 +626,8 @@ class CallAndReferenceGenerator( if (!needSamConversion(argument, parameter)) { return this } - var samType = parameter.returnTypeRef.toIrType(ConversionTypeContext.WITH_INVARIANT) + val samFirType = parameter.returnTypeRef.coneTypeSafe()?.let { substitutor.substituteOrSelf(it) } + var samType = samFirType?.toIrType(ConversionTypeContext.WITH_INVARIANT) ?: createErrorType() if (shouldUnwrapVarargType) { samType = samType.getArrayElementType(irBuiltIns) } diff --git a/compiler/testData/codegen/box/sam/recordSubstitutedTypeForCallableSamParameter.kt b/compiler/testData/codegen/box/sam/recordSubstitutedTypeForCallableSamParameter.kt index 613218c6f03..56ae5eedccf 100644 --- a/compiler/testData/codegen/box/sam/recordSubstitutedTypeForCallableSamParameter.kt +++ b/compiler/testData/codegen/box/sam/recordSubstitutedTypeForCallableSamParameter.kt @@ -1,7 +1,6 @@ // !LANGUAGE: +NewInference +SamConversionPerArgument +SamConversionForKotlinFunctions +FunctionalInterfaceConversion // WITH_REFLECT // FULL_JDK -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // FILE: Provider.java diff --git a/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall.fir.kt.txt b/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall.fir.kt.txt index 53195465e1f..933ecc446f7 100644 --- a/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall.fir.kt.txt @@ -1,8 +1,8 @@ fun test1(f: Function1): C { - return C(jxx = f /*-> J? */) + return C(jxx = f /*-> J? */) } fun test2(x: Any) { x as Function1 /*~> Unit */ - C(jxx = x /*as Function1 */ /*-> J? */) /*~> Unit */ + C(jxx = x /*as Function1 */ /*-> J? */) /*~> Unit */ } diff --git a/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall.fir.txt b/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall.fir.txt index e609956c03f..457d1b01784 100644 --- a/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall.fir.txt +++ b/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall.fir.txt @@ -5,7 +5,7 @@ FILE fqName: fileName:/samConversionInGenericConstructorCall.kt RETURN type=kotlin.Nothing from='public final fun test1 (f: kotlin.Function1): .C declared in ' 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?>? + jxx: TYPE_OP type=.J? origin=SAM_CONVERSION typeOperand=.J? 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 @@ -16,6 +16,6 @@ FILE fqName: fileName:/samConversionInGenericConstructorCall.kt 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?>? + jxx: TYPE_OP type=.J? origin=SAM_CONVERSION typeOperand=.J? 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.kt.txt b/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall_NI.fir.kt.txt index fcde5506071..755e77acfeb 100644 --- a/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall_NI.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall_NI.fir.kt.txt @@ -1,5 +1,5 @@ fun test3(f1: Function1, f2: Function1): D { - return C(jxx = f1 /*-> J? */).D(jxy = f2 /*-> J? */) + return C(jxx = f1 /*-> J? */).D(jxy = f2 /*-> J? */) } class Outer { @@ -29,14 +29,14 @@ class Outer { } fun test4(f: Function1, g: Function1): Inner { - return Outer(j11 = f /*-> J */).Inner(j12 = g /*-> J */) + return Outer(j11 = f /*-> J */).Inner(j12 = g /*-> J */) } fun testGenericJavaCtor1(f: Function1): G { - return G(x = f /*-> J? */) + return G(x = f /*-> J? */) } fun testGenericJavaCtor2(x: Any) { x as Function1 /*~> Unit */ - G(x = x /*as Function1 */ /*-> J? */) /*~> Unit */ + G(x = x /*as Function1 */ /*-> J? */) /*~> Unit */ } 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 eddf1c4f215..d2185903d91 100644 --- a/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall_NI.fir.txt +++ b/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall_NI.fir.txt @@ -8,9 +8,9 @@ FILE fqName: fileName:/samConversionInGenericConstructorCall_NI.kt : kotlin.Int? $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?>? + jxx: TYPE_OP type=.J? origin=SAM_CONVERSION typeOperand=.J? 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?>? + jxy: TYPE_OP type=.J? origin=SAM_CONVERSION typeOperand=.J? 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> @@ -86,9 +86,9 @@ FILE fqName: fileName:/samConversionInGenericConstructorCall_NI.kt : kotlin.Any? $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> + j11: TYPE_OP type=.J origin=SAM_CONVERSION typeOperand=.J 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> + j12: TYPE_OP type=.J origin=SAM_CONVERSION typeOperand=.J 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 @@ -97,7 +97,7 @@ FILE fqName: fileName:/samConversionInGenericConstructorCall_NI.kt 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?>? + x: TYPE_OP type=.J? origin=SAM_CONVERSION typeOperand=.J? 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 @@ -109,6 +109,6 @@ FILE fqName: fileName:/samConversionInGenericConstructorCall_NI.kt 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?>? + x: TYPE_OP type=.J? origin=SAM_CONVERSION typeOperand=.J? 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.kt.txt b/compiler/testData/ir/irText/expressions/sam/samConversionToGeneric.fir.kt.txt index d4621f45e1a..4a6b72912b2 100644 --- a/compiler/testData/ir/irText/expressions/sam/samConversionToGeneric.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/sam/samConversionToGeneric.fir.kt.txt @@ -16,7 +16,7 @@ fun test3() { return bar(j = local fun (x: String): String? { return x } - /*-> J? */) + /*-> J? */) } fun test4(a: Any) { @@ -26,16 +26,16 @@ fun test4(a: Any) { fun test5(a: Any) { a as Function1 /*~> Unit */ - bar(j = a /*as Function1 */ /*-> J? */) + bar(j = a /*as Function1 */ /*-> J? */) } fun test6(a: Function1) { - bar(j = a /*-> J? */) + bar(j = a /*-> J? */) } fun test7(a: Any) { a as Function1 /*~> Unit */ - bar(j = a /*as Function1 */ /*-> J? */) + bar(j = a /*as Function1 */ /*-> J? */) } fun test8(efn: @ExtensionFunctionType Function1): J { @@ -43,9 +43,9 @@ fun test8(efn: @ExtensionFunctionType Function1): J { } fun test9(efn: @ExtensionFunctionType Function1) { - bar(j = efn /*-> J? */) + bar(j = efn /*-> J? */) } fun test10(fn: Function1) { - bar2x(j2x = fn /*-> J2X? */) + bar2x(j2x = fn /*-> J2X? */) } diff --git a/compiler/testData/ir/irText/expressions/sam/samConversionToGeneric.fir.txt b/compiler/testData/ir/irText/expressions/sam/samConversionToGeneric.fir.txt index 00e1e8586da..8197321a138 100644 --- a/compiler/testData/ir/irText/expressions/sam/samConversionToGeneric.fir.txt +++ b/compiler/testData/ir/irText/expressions/sam/samConversionToGeneric.fir.txt @@ -24,7 +24,7 @@ FILE fqName: fileName:/samConversionToGeneric.kt RETURN type=kotlin.Nothing from='public final fun test3 (): kotlin.Unit declared in ' 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?>? + j: TYPE_OP type=.J? origin=SAM_CONVERSION typeOperand=.J? FUN_EXPR type=kotlin.Function1 origin=LAMBDA FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (x:kotlin.String) returnType:kotlin.String? VALUE_PARAMETER name:x index:0 type:kotlin.String @@ -49,7 +49,7 @@ FILE fqName: fileName:/samConversionToGeneric.kt GET_VAR 'a: kotlin.Any declared in .test5' type=kotlin.Any origin=null CALL 'public open fun bar (j: .J.H.bar?>?): kotlin.Unit declared in .H' type=kotlin.Unit origin=null : kotlin.String? - j: TYPE_OP type=.J.H.bar?>? origin=SAM_CONVERSION typeOperand=.J.H.bar?>? + j: TYPE_OP type=.J? origin=SAM_CONVERSION typeOperand=.J? TYPE_OP type=kotlin.Function1 origin=IMPLICIT_CAST typeOperand=kotlin.Function1 GET_VAR 'a: kotlin.Any declared in .test5' type=kotlin.Any origin=null FUN name:test6 visibility:public modality:FINAL (a:kotlin.Function1.test6, T of .test6>) returnType:kotlin.Unit @@ -58,7 +58,7 @@ FILE fqName: fileName:/samConversionToGeneric.kt BLOCK_BODY 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?>? + j: TYPE_OP type=.J.test6?>? origin=SAM_CONVERSION typeOperand=.J.test6?>? 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?] @@ -69,7 +69,7 @@ FILE fqName: fileName:/samConversionToGeneric.kt GET_VAR 'a: kotlin.Any declared in .test7' type=kotlin.Any origin=null CALL 'public open fun bar (j: .J.H.bar?>?): kotlin.Unit 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?>? + j: TYPE_OP type=.J.test7?>? origin=SAM_CONVERSION typeOperand=.J.test7?>? TYPE_OP type=kotlin.Function1.test7, T of .test7> origin=IMPLICIT_CAST typeOperand=kotlin.Function1.test7, T of .test7> GET_VAR 'a: kotlin.Any declared in .test7' type=kotlin.Any origin=null FUN name:test8 visibility:public modality:FINAL <> (efn:@[ExtensionFunctionType] kotlin.Function1) returnType:.J @@ -83,12 +83,12 @@ FILE fqName: fileName:/samConversionToGeneric.kt 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?>? + j: TYPE_OP type=.J? origin=SAM_CONVERSION typeOperand=.J? GET_VAR 'efn: @[ExtensionFunctionType] kotlin.Function1 declared in .test9' type=@[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?>? + j2x: TYPE_OP type=.J2X? origin=SAM_CONVERSION typeOperand=.J2X? GET_VAR 'fn: kotlin.Function1 declared in .test10' type=kotlin.Function1 origin=null diff --git a/compiler/testData/ir/irText/expressions/sam/samConversionsWithSmartCasts.fir.kt.txt b/compiler/testData/ir/irText/expressions/sam/samConversionsWithSmartCasts.fir.kt.txt index 8a6af5e2cfa..af0fe975b4a 100644 --- a/compiler/testData/ir/irText/expressions/sam/samConversionsWithSmartCasts.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/sam/samConversionsWithSmartCasts.fir.kt.txt @@ -48,7 +48,7 @@ fun test7(a: Function1) { } fun test8(a: Function0) { - J().run1(r = id?>(x = a) /*-> Runnable? */) + J().run1(r = id?>(x = a /*-> Function0? */) /*-> Runnable? */) } fun test9() { diff --git a/compiler/testData/ir/irText/expressions/sam/samConversionsWithSmartCasts.fir.txt b/compiler/testData/ir/irText/expressions/sam/samConversionsWithSmartCasts.fir.txt index 720cf65c0da..78d04844292 100644 --- a/compiler/testData/ir/irText/expressions/sam/samConversionsWithSmartCasts.fir.txt +++ b/compiler/testData/ir/irText/expressions/sam/samConversionsWithSmartCasts.fir.txt @@ -104,7 +104,8 @@ FILE fqName: fileName:/samConversionsWithSmartCasts.kt r: TYPE_OP type=java.lang.Runnable? origin=SAM_CONVERSION typeOperand=java.lang.Runnable? 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=null + x: TYPE_OP type=kotlin.Function0? origin=SAM_CONVERSION typeOperand=kotlin.Function0? + 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