diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/Fir2IrTextTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/Fir2IrTextTestGenerated.java index 5da81bdddaa..620a0e9cb58 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/Fir2IrTextTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/Fir2IrTextTestGenerated.java @@ -1058,6 +1058,12 @@ public class Fir2IrTextTestGenerated extends AbstractFir2IrTextTest { runTest("compiler/testData/ir/irText/expressions/chainOfSafeCalls.kt"); } + @Test + @TestMetadata("chainedFunSuspendConversionForSimpleExpression.kt") + public void testChainedFunSuspendConversionForSimpleExpression() throws Exception { + runTest("compiler/testData/ir/irText/expressions/chainedFunSuspendConversionForSimpleExpression.kt"); + } + @Test @TestMetadata("classReference.kt") public void testClassReference() throws Exception { @@ -1646,12 +1652,24 @@ public class Fir2IrTextTestGenerated extends AbstractFir2IrTextTest { runTest("compiler/testData/ir/irText/expressions/stringTemplates.kt"); } + @Test + @TestMetadata("suspendConversionInVararg.kt") + public void testSuspendConversionInVararg() throws Exception { + runTest("compiler/testData/ir/irText/expressions/suspendConversionInVararg.kt"); + } + @Test @TestMetadata("suspendConversionOnArbitraryExpression.kt") public void testSuspendConversionOnArbitraryExpression() throws Exception { runTest("compiler/testData/ir/irText/expressions/suspendConversionOnArbitraryExpression.kt"); } + @Test + @TestMetadata("suspendConversionWithFunInterfaces.kt") + public void testSuspendConversionWithFunInterfaces() throws Exception { + runTest("compiler/testData/ir/irText/expressions/suspendConversionWithFunInterfaces.kt"); + } + @Test @TestMetadata("temporaryInEnumEntryInitializer.kt") public void testTemporaryInEnumEntryInitializer() throws Exception { diff --git a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/ArgumentsGenerationUtils.kt b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/ArgumentsGenerationUtils.kt index 1857dfd99e6..166269d3067 100644 --- a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/ArgumentsGenerationUtils.kt +++ b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/ArgumentsGenerationUtils.kt @@ -230,7 +230,7 @@ private fun StatementGenerator.generateReceiverForCalleeImportedFromObject( private fun StatementGenerator.generateVarargExpressionUsing( varargArgument: VarargValueArgument, valueParameter: ValueParameterDescriptor, - @Suppress("UNUSED_PARAMETER") resolvedCall: ResolvedCall<*>, // TODO resolvedCall is required for suspend conversions, see KT-38604 + resolvedCall: ResolvedCall<*>, generateArgumentExpression: (KtExpression) -> IrExpression? ): IrExpression? { if (varargArgument.arguments.isEmpty()) { @@ -249,16 +249,21 @@ private fun StatementGenerator.generateVarargExpressionUsing( val irVararg = IrVarargImpl(varargStartOffset, varargEndOffset, valueParameter.type.toIrType(), varargElementType.toIrType()) - for (argument in varargArgument.arguments) { - val ktArgumentExpression = argument.getArgumentExpression() - ?: throw AssertionError("No argument expression for vararg element ${argument.asElement().text}") - val irArgumentExpression = generateArgumentExpression(ktArgumentExpression) - ?: throw AssertionError("'generateArgumentExpression' should return non-null for vararg element ${ktArgumentExpression.text}") + for (varargElementArgument in varargArgument.arguments) { + val ktArgumentExpression = varargElementArgument.getArgumentExpression() + ?: throw AssertionError("No argument expression for vararg element ${varargElementArgument.asElement().text}") + val irArgumentExpression = + generateArgumentExpression(ktArgumentExpression) + ?.let { irArg -> + applySuspendConversionForValueArgumentIfRequired(irArg, varargElementArgument, valueParameter, resolvedCall) + } + ?: throw AssertionError("no expression for vararg element ${ktArgumentExpression.text}") + val irVarargElement = - if (argument.getSpreadElement() != null || + if (varargElementArgument.getSpreadElement() != null || context.languageVersionSettings .supportsFeature(LanguageFeature.AllowAssigningArrayElementsToVarargsInNamedFormForFunctions) && - argument.isNamed() + varargElementArgument.isNamed() ) IrSpreadElementImpl( ktArgumentExpression.startOffsetSkippingComments, ktArgumentExpression.endOffset, @@ -323,17 +328,24 @@ private fun StatementGenerator.applySuspendConversionForValueArgumentIfRequired( val valueParameterType = if (valueParameter.isVararg) valueParameter.varargElementType!! else valueParameter.type - val irSuspendFunType = valueParameterType.toIrType() - return IrBlockImpl(expression.startOffset, expression.endOffset, irSuspendFunType, IrStatementOrigin.SUSPEND_CONVERSION).apply { - val irAdapterFunction = createFunctionForSuspendConversion(startOffset, endOffset, suspendConversionType, valueParameterType) - // TODO add a bound receiver property to IrFunctionExpressionImpl? - val irAdapterRef = IrFunctionReferenceImpl( - startOffset, endOffset, irSuspendFunType, irAdapterFunction.symbol, irAdapterFunction.typeParameters.size, - irAdapterFunction.valueParameters.size, null, IrStatementOrigin.SUSPEND_CONVERSION - ) - statements.add(irAdapterFunction) - statements.add(irAdapterRef.apply { extensionReceiver = expression }) - } + val suspendFunType: KotlinType = + if (context.extensions.samConversion.isSamType(valueParameterType)) + valueParameterType.getSubstitutedFunctionTypeForSamType() + else + valueParameterType + + val irAdapterRefType = suspendFunType.toIrType() + return IrBlockImpl(expression.startOffset, expression.endOffset, irAdapterRefType, IrStatementOrigin.SUSPEND_CONVERSION) + .apply { + val irAdapterFunction = createFunctionForSuspendConversion(startOffset, endOffset, suspendConversionType, suspendFunType) + // TODO add a bound receiver property to IrFunctionExpressionImpl? + val irAdapterRef = IrFunctionReferenceImpl( + startOffset, endOffset, irAdapterRefType, irAdapterFunction.symbol, irAdapterFunction.typeParameters.size, + irAdapterFunction.valueParameters.size, null, IrStatementOrigin.SUSPEND_CONVERSION + ) + statements.add(irAdapterFunction) + statements.add(irAdapterRef.apply { extensionReceiver = expression }) + } } private fun StatementGenerator.createFunctionForSuspendConversion( @@ -343,8 +355,7 @@ private fun StatementGenerator.createFunctionForSuspendConversion( suspendFunType: KotlinType ): IrSimpleFunction { val irFunReturnType = funType.arguments.last().type.toIrType() - val suspendFunReturnType = suspendFunType.arguments.last().type - val irSuspendFunReturnType = suspendFunReturnType.toIrType() + val irSuspendFunReturnType = suspendFunType.arguments.last().type.toIrType() val irAdapterFun = context.irFactory.createFunction( startOffset, endOffset, @@ -395,7 +406,7 @@ private fun StatementGenerator.createFunctionForSuspendConversion( for (irAdapterParameter in irAdapterFun.valueParameters) { irAdapteeCall.putValueArgument(irAdapterParameter.index, irGet(irAdapterParameter)) } - if (suspendFunReturnType.isUnit()) { + if (suspendFunType.arguments.last().type.isUnit()) { +irAdapteeCall } else { +IrReturnImpl( @@ -592,15 +603,29 @@ fun StatementGenerator.generateSamConversionForValueArgumentsIfRequired(call: Ca val irSamType = substitutedSamType.toIrType() - fun samConvertScalarExpression(irArgument: IrExpression) = + fun IrExpression.isFunctionReferenceAdapter() = + this is IrBlock && (origin == IrStatementOrigin.SUSPEND_CONVERSION || origin == IrStatementOrigin.ADAPTED_FUNCTION_REFERENCE) + + fun IrExpression.applySamConversion() = IrTypeOperatorCallImpl( - irArgument.startOffset, irArgument.endOffset, + startOffset, endOffset, irSamType, - IrTypeOperator.SAM_CONVERSION, - irSamType, - castArgumentToFunctionalInterfaceForSamType(irArgument, substitutedSamType) + IrTypeOperator.SAM_CONVERSION, irSamType, + castArgumentToFunctionalInterfaceForSamType(this, substitutedSamType) ) + fun samConvertScalarExpression(irArgument: IrExpression) = + if (irArgument.isFunctionReferenceAdapter()) { + // Apply SAM_CONVERSION directly to the adapter reference + val irBlock = irArgument as IrBlock + irBlock.type = irSamType + val irAdapterRef = irBlock.statements.last() as IrFunctionReference + irBlock.statements[irBlock.statements.lastIndex] = irAdapterRef.applySamConversion() + irBlock + } else { + irArgument.applySamConversion() + } + call.irValueArgumentsByIndex[i] = if (originalArgument !is IrVararg) { samConvertScalarExpression(originalArgument) diff --git a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/transformations/InsertImplicitCasts.kt b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/transformations/InsertImplicitCasts.kt index c1e7d1c0c5a..e6d317a4468 100644 --- a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/transformations/InsertImplicitCasts.kt +++ b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/transformations/InsertImplicitCasts.kt @@ -286,9 +286,10 @@ internal class InsertImplicitCasts( override fun visitTypeOperator(expression: IrTypeOperatorCall): IrExpression = when (expression.operator) { - IrTypeOperator.SAM_CONVERSION -> expression.transformPostfix { - argument = argument.cast(typeOperand.originalKotlinType!!.getSubstitutedFunctionTypeForSamType()) - } + IrTypeOperator.SAM_CONVERSION -> + expression.transformPostfix { + argument = argument.cast(typeOperand.originalKotlinType!!.getSubstitutedFunctionTypeForSamType()) + } IrTypeOperator.IMPLICIT_CAST -> { // This branch is required for handling specific ambiguous cases in implicit cast insertion, diff --git a/compiler/testData/codegen/box/suspendConversion/basicSuspendConversion.kt b/compiler/testData/codegen/box/suspendConversion/basicSuspendConversion.kt index 04edc8571cd..0bb2f12ef95 100644 --- a/compiler/testData/codegen/box/suspendConversion/basicSuspendConversion.kt +++ b/compiler/testData/codegen/box/suspendConversion/basicSuspendConversion.kt @@ -1,3 +1,6 @@ +// IGNORE_BACKEND: JVM +// IGNORE_BACKEND: WASM + // !LANGUAGE: +SuspendConversion // !DIAGNOSTICS: -UNUSED_PARAMETER diff --git a/compiler/testData/codegen/box/suspendConversion/basicSuspendConversion.txt b/compiler/testData/codegen/box/suspendConversion/basicSuspendConversion.txt deleted file mode 100644 index 7abf5398088..00000000000 --- a/compiler/testData/codegen/box/suspendConversion/basicSuspendConversion.txt +++ /dev/null @@ -1,6 +0,0 @@ -package - -public fun foo1(/*0*/ f: suspend () -> kotlin.String): kotlin.Unit -public fun foo2(/*0*/ f: suspend (kotlin.Int) -> kotlin.String): kotlin.Unit -public fun foo3(/*0*/ f: suspend () -> kotlin.Unit): kotlin.Unit -public fun test(/*0*/ f0: suspend () -> kotlin.String, /*1*/ f1: () -> kotlin.String, /*2*/ f2: (kotlin.Int) -> kotlin.String, /*3*/ f3: () -> kotlin.Unit): kotlin.Unit diff --git a/compiler/testData/codegen/box/suspendConversion/basicSuspendConversionForCallableReference.kt b/compiler/testData/codegen/box/suspendConversion/basicSuspendConversionForCallableReference.kt index 4c3a81696eb..6e2c7c02f3b 100644 --- a/compiler/testData/codegen/box/suspendConversion/basicSuspendConversionForCallableReference.kt +++ b/compiler/testData/codegen/box/suspendConversion/basicSuspendConversionForCallableReference.kt @@ -1,5 +1,6 @@ // !LANGUAGE: +SuspendConversion // !DIAGNOSTICS: -UNUSED_PARAMETER +// IGNORE_BACKEND: WASM fun foo1(f: suspend () -> Unit) {} fun bar1() {} diff --git a/compiler/testData/codegen/box/suspendConversion/basicSuspendConversionForCallableReference.txt b/compiler/testData/codegen/box/suspendConversion/basicSuspendConversionForCallableReference.txt deleted file mode 100644 index 93d0d2da1dd..00000000000 --- a/compiler/testData/codegen/box/suspendConversion/basicSuspendConversionForCallableReference.txt +++ /dev/null @@ -1,8 +0,0 @@ -package - -public fun bar1(): kotlin.Unit -public fun bar2(/*0*/ x: kotlin.Int): kotlin.Unit -public fun bar2(/*0*/ s: kotlin.String): kotlin.Unit -public fun foo1(/*0*/ f: suspend () -> kotlin.Unit): kotlin.Unit -public fun foo2(/*0*/ e: T, /*1*/ f: suspend (T) -> kotlin.Unit): kotlin.Unit -public fun test(): kotlin.Unit diff --git a/compiler/testData/codegen/box/suspendConversion/basicSuspendConversionGenerics.kt b/compiler/testData/codegen/box/suspendConversion/basicSuspendConversionGenerics.kt index 13ef6707a8f..ff26811ac80 100644 --- a/compiler/testData/codegen/box/suspendConversion/basicSuspendConversionGenerics.kt +++ b/compiler/testData/codegen/box/suspendConversion/basicSuspendConversionGenerics.kt @@ -1,7 +1,13 @@ +// TARGET_BACKEND: JVM +// ^ TODO: get rid of T::class.java +// IGNORE_BACKEND: JVM + // !LANGUAGE: +SuspendConversion // !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_EXPRESSION // WITH_RUNTIME +class C + class Inv2 inline fun materialize(): T = T::class.java.newInstance() @@ -10,42 +16,30 @@ inline fun foo1(crossinline f: suspend (T) -> String): T = materiali inline fun foo2(crossinline f: suspend () -> T): T = materialize() inline fun foo3(crossinline f: suspend (T) -> K): Inv2 = Inv2() -fun foo11(f: suspend (T) -> String): T = 1 as T +fun foo11(f: suspend (T) -> String): T = C() as T fun foo21(f: suspend () -> T): T = "" as T fun foo31(f: suspend (T) -> K): Inv2 = Inv2() fun id(e: I): I = e -fun test(f: (Int) -> String, g: () -> String) { +fun test(f: (C) -> String, g: () -> String) { val a0 = foo1(f) val a01 = foo11(f) - a0 - a01 val a1 = foo2(g) val a11 = foo21(g) - a1 - a11 val a2 = foo3(f) val a21 = foo31(f) - ")!>a2 - ")!>a21 val a3 = foo1(id(f)) val a31 = foo11(id(f)) - a3 - a31 val a4 = foo2(id(g)) val a41 = foo21(id(g)) - a4 - a41 val a5 = foo3(id(f)) val a51 = foo31(id(f)) - ")!>a5 - ")!>a51 } fun box(): String { diff --git a/compiler/testData/codegen/box/suspendConversion/basicSuspendConversionGenerics.txt b/compiler/testData/codegen/box/suspendConversion/basicSuspendConversionGenerics.txt deleted file mode 100644 index 260f7221920..00000000000 --- a/compiler/testData/codegen/box/suspendConversion/basicSuspendConversionGenerics.txt +++ /dev/null @@ -1,14 +0,0 @@ -package - -public fun foo1(/*0*/ f: suspend (T) -> kotlin.String): T -public fun foo2(/*0*/ f: suspend () -> T): T -public fun foo3(/*0*/ f: suspend (T) -> K): Inv2 -public fun id(/*0*/ e: I): I -public fun test(/*0*/ f: (kotlin.Int) -> kotlin.String, /*1*/ g: () -> kotlin.String): kotlin.Unit - -public final class Inv2 { - public constructor Inv2() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} diff --git a/compiler/testData/codegen/box/suspendConversion/chainedFunSuspendConversionForSimpleExpression.kt b/compiler/testData/codegen/box/suspendConversion/chainedFunSuspendConversionForSimpleExpression.kt index 31c9923c99b..ec2a4726762 100644 --- a/compiler/testData/codegen/box/suspendConversion/chainedFunSuspendConversionForSimpleExpression.kt +++ b/compiler/testData/codegen/box/suspendConversion/chainedFunSuspendConversionForSimpleExpression.kt @@ -1,6 +1,6 @@ -// FIR_IDENTICAL // !LANGUAGE: +SuspendConversion -// !DIAGNOSTICS: -UNUSED_PARAMETER +// IGNORE_BACKEND: JVM +// IGNORE_BACKEND_FIR: JVM_IR fun interface SuspendRunnable { suspend fun invoke() diff --git a/compiler/testData/codegen/box/suspendConversion/chainedFunSuspendConversionForSimpleExpression.txt b/compiler/testData/codegen/box/suspendConversion/chainedFunSuspendConversionForSimpleExpression.txt deleted file mode 100644 index 2a0041e2544..00000000000 --- a/compiler/testData/codegen/box/suspendConversion/chainedFunSuspendConversionForSimpleExpression.txt +++ /dev/null @@ -1,11 +0,0 @@ -package - -public fun foo(/*0*/ s: SuspendRunnable): kotlin.Unit -public fun test(/*0*/ f: () -> kotlin.Unit): kotlin.Unit - -public fun interface SuspendRunnable { - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public abstract suspend fun invoke(): kotlin.Unit - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} diff --git a/compiler/testData/codegen/box/suspendConversion/overloadResolutionBySuspendModifier.kt b/compiler/testData/codegen/box/suspendConversion/overloadResolutionBySuspendModifier.kt index 1d371fb3127..c3cdcdcd1d9 100644 --- a/compiler/testData/codegen/box/suspendConversion/overloadResolutionBySuspendModifier.kt +++ b/compiler/testData/codegen/box/suspendConversion/overloadResolutionBySuspendModifier.kt @@ -1,13 +1,17 @@ // !LANGUAGE: +SuspendConversion // !DIAGNOSTICS: -UNUSED_PARAMETER +// IGNORE_BACKEND: JVM +// IGNORE_BACKEND: WASM -fun foo(x: () -> Int) {} -fun foo(x: suspend () -> Int) {} +var foo1 = false +var foo2 = false + +fun foo(x: () -> Int) { foo1 = true } +fun foo(x: suspend () -> Int) { foo2 = true} fun usualCall(): Int = 42 suspend fun suspendCall(): Int = 42 -// candidate without suspend conversions is more specific fun test2(f: () -> Int, g: suspend () -> Int) { foo(f) foo(g) @@ -15,5 +19,8 @@ fun test2(f: () -> Int, g: suspend () -> Int) { fun box(): String { test2({ 1 }, { 2 }) - return "OK" + return if (foo1 && foo2) + "OK" + else + "foo1: $foo1; foo2: $foo2" } \ No newline at end of file diff --git a/compiler/testData/codegen/box/suspendConversion/overloadResolutionBySuspendModifier.txt b/compiler/testData/codegen/box/suspendConversion/overloadResolutionBySuspendModifier.txt deleted file mode 100644 index 6ffdb905ef2..00000000000 --- a/compiler/testData/codegen/box/suspendConversion/overloadResolutionBySuspendModifier.txt +++ /dev/null @@ -1,8 +0,0 @@ -package - -public fun foo(/*0*/ x: () -> kotlin.Int): kotlin.Unit -public fun foo(/*0*/ x: suspend () -> kotlin.Int): kotlin.Unit -public suspend fun suspendCall(): kotlin.Int -public fun test1(): kotlin.Unit -public fun test2(/*0*/ f: () -> kotlin.Int, /*1*/ g: suspend () -> kotlin.Int): kotlin.Unit -public fun usualCall(): kotlin.Int diff --git a/compiler/testData/codegen/box/suspendConversion/severalConversionsInOneCall.kt b/compiler/testData/codegen/box/suspendConversion/severalConversionsInOneCall.kt index fde0ad8dc59..e131f01169f 100644 --- a/compiler/testData/codegen/box/suspendConversion/severalConversionsInOneCall.kt +++ b/compiler/testData/codegen/box/suspendConversion/severalConversionsInOneCall.kt @@ -1,6 +1,8 @@ // FIR_IDENTICAL // !LANGUAGE: +SuspendConversion // !DIAGNOSTICS: -UNUSED_PARAMETER +// IGNORE_BACKEND: JVM +// IGNORE_BACKEND: WASM fun foo(f: () -> String, g: suspend () -> String, h: suspend () -> String) {} diff --git a/compiler/testData/codegen/box/suspendConversion/severalConversionsInOneCall.txt b/compiler/testData/codegen/box/suspendConversion/severalConversionsInOneCall.txt deleted file mode 100644 index be200b8eadc..00000000000 --- a/compiler/testData/codegen/box/suspendConversion/severalConversionsInOneCall.txt +++ /dev/null @@ -1,4 +0,0 @@ -package - -public fun foo(/*0*/ f: () -> kotlin.String, /*1*/ g: suspend () -> kotlin.String, /*2*/ h: suspend () -> kotlin.String): kotlin.Unit -public fun test(/*0*/ f: () -> kotlin.String, /*1*/ g: suspend () -> kotlin.String): kotlin.Unit diff --git a/compiler/testData/codegen/box/suspendConversion/suspendAndFunConversionInDisabledMode.kt b/compiler/testData/codegen/box/suspendConversion/suspendAndFunConversionInDisabledMode.kt index 6bfe53909dd..2a4c1633378 100644 --- a/compiler/testData/codegen/box/suspendConversion/suspendAndFunConversionInDisabledMode.kt +++ b/compiler/testData/codegen/box/suspendConversion/suspendAndFunConversionInDisabledMode.kt @@ -1,5 +1,12 @@ // !LANGUAGE: +SuspendConversion // !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_EXPRESSION +// IGNORE_BACKEND: JVM +// IGNORE_BACKEND: WASM +// IGNORE_BACKEND_FIR: JVM_IR + +fun interface Runnable { + fun run() +} fun interface SuspendRunnable { suspend fun run() @@ -12,7 +19,7 @@ object Test1 { fun call(r: SuspendRunnable) {} fun bar(f: () -> Unit) { - call(f) + call(f) } } } @@ -24,13 +31,13 @@ object Test2 { fun call(r: SuspendRunnable) {} fun bar(f: () -> Unit) { - call(f) + call(f) } } } fun box(): String { - Test2.Scope.bar { } Test1.Scope.bar { } + Test2.Scope.bar { } return "OK" } diff --git a/compiler/testData/codegen/box/suspendConversion/suspendAndFunConversionInDisabledMode.txt b/compiler/testData/codegen/box/suspendConversion/suspendAndFunConversionInDisabledMode.txt deleted file mode 100644 index 2e7066b7f5b..00000000000 --- a/compiler/testData/codegen/box/suspendConversion/suspendAndFunConversionInDisabledMode.txt +++ /dev/null @@ -1,42 +0,0 @@ -package - -public fun interface SuspendRunnable { - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public abstract suspend fun run(): kotlin.Unit - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} - -public object Test1 { - private constructor Test1() - public final fun call(/*0*/ r: () -> kotlin.Unit): kotlin.Unit - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - - public object Scope { - private constructor Scope() - public final fun bar(/*0*/ f: () -> kotlin.Unit): kotlin.Unit - public final fun call(/*0*/ r: SuspendRunnable): kotlin.Unit - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - } -} - -public object Test2 { - private constructor Test2() - public final fun call(/*0*/ r: java.lang.Runnable): kotlin.Unit - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - - public object Scope { - private constructor Scope() - public final fun bar(/*0*/ f: () -> kotlin.Unit): kotlin.Unit - public final fun call(/*0*/ r: SuspendRunnable): kotlin.Unit - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - } -} diff --git a/compiler/testData/codegen/box/suspendConversion/suspendConversionCompatibility.kt b/compiler/testData/codegen/box/suspendConversion/suspendConversionCompatibility.kt index fec6f3d6cf4..6dba04bfd41 100644 --- a/compiler/testData/codegen/box/suspendConversion/suspendConversionCompatibility.kt +++ b/compiler/testData/codegen/box/suspendConversion/suspendConversionCompatibility.kt @@ -1,6 +1,8 @@ // !LANGUAGE: +SuspendConversion // !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_EXPRESSION // WITH_RUNTIME +// IGNORE_BACKEND: WASM +// IGNORE_BACKEND_FIR: JVM_IR object Test1 { fun foo(f: () -> Unit) {} @@ -9,7 +11,7 @@ object Test1 { fun foo(f: suspend () -> Unit) {} fun test(g: () -> Unit) { - foo(g) + foo(g) } } } @@ -25,8 +27,6 @@ object Test2 { fun test() { val result = foo(::bar) val result2 = foo2(::bar) - result - result2 } } } @@ -43,8 +43,6 @@ object Test3 { fun test() { val result = foo(::bar) val result2 = foo2(::bar) - result - result2 } } } diff --git a/compiler/testData/codegen/box/suspendConversion/suspendConversionCompatibility.txt b/compiler/testData/codegen/box/suspendConversion/suspendConversionCompatibility.txt deleted file mode 100644 index 0cb22c2e490..00000000000 --- a/compiler/testData/codegen/box/suspendConversion/suspendConversionCompatibility.txt +++ /dev/null @@ -1,54 +0,0 @@ -package - -public object Test1 { - private constructor Test1() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final fun foo(/*0*/ f: () -> kotlin.Unit): kotlin.Unit - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - - public object Scope { - private constructor Scope() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final fun foo(/*0*/ f: suspend () -> kotlin.Unit): kotlin.Unit - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun test(/*0*/ g: () -> kotlin.Unit): kotlin.Unit - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - } -} - -public object Test2 { - private constructor Test2() - public final suspend fun bar(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final fun foo(/*0*/ f: suspend () -> T): T - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - - public object Scope { - private constructor Scope() - public final fun bar(): kotlin.String - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun test(): kotlin.Unit - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - } -} - -public object Test3 { - private constructor Test3() - public final suspend fun bar(/*0*/ x: kotlin.Int = ...): kotlin.Int - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final fun foo(/*0*/ f: suspend () -> T): T - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - - public object Scope { - private constructor Scope() - public final fun bar(/*0*/ x: kotlin.Int = ...): kotlin.String - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun test(): kotlin.Unit - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - } -} diff --git a/compiler/testData/codegen/box/suspendConversion/suspendConversionOnVarargElements.kt b/compiler/testData/codegen/box/suspendConversion/suspendConversionOnVarargElements.kt index e5756d9ae53..1599aab5ff1 100644 --- a/compiler/testData/codegen/box/suspendConversion/suspendConversionOnVarargElements.kt +++ b/compiler/testData/codegen/box/suspendConversion/suspendConversionOnVarargElements.kt @@ -1,6 +1,9 @@ // FIR_IDENTICAL // !LANGUAGE: +SuspendConversion // !DIAGNOSTICS: -UNUSED_PARAMETER +// IGNORE_BACKEND: JVM +// IGNORE_BACKEND: WASM +// IGNORE_BACKEND_FIR: JVM_IR fun useSuspendVararg(vararg sfn: suspend () -> Unit) {} diff --git a/compiler/testData/codegen/box/suspendConversion/suspendConversionOnVarargElements.txt b/compiler/testData/codegen/box/suspendConversion/suspendConversionOnVarargElements.txt deleted file mode 100644 index 7762406fa30..00000000000 --- a/compiler/testData/codegen/box/suspendConversion/suspendConversionOnVarargElements.txt +++ /dev/null @@ -1,5 +0,0 @@ -package - -public fun testSuspendConversionInVarargElementsAll(/*0*/ f1: () -> kotlin.Unit, /*1*/ f2: () -> kotlin.Unit, /*2*/ f3: () -> kotlin.Unit): kotlin.Unit -public fun testSuspendConversionInVarargElementsSome(/*0*/ sf1: suspend () -> kotlin.Unit, /*1*/ f2: () -> kotlin.Unit, /*2*/ sf3: suspend () -> kotlin.Unit): kotlin.Unit -public fun useSuspendVararg(/*0*/ vararg sfn: suspend () -> kotlin.Unit /*kotlin.Array kotlin.Unit>*/): kotlin.Unit diff --git a/compiler/testData/codegen/box/suspendConversion/suspendConversionWithFunInterfaces.kt b/compiler/testData/codegen/box/suspendConversion/suspendConversionWithFunInterfaces.kt index d220a8989e8..67f2b5331bd 100644 --- a/compiler/testData/codegen/box/suspendConversion/suspendConversionWithFunInterfaces.kt +++ b/compiler/testData/codegen/box/suspendConversion/suspendConversionWithFunInterfaces.kt @@ -1,6 +1,7 @@ // FIR_IDENTICAL // !LANGUAGE: +SuspendConversion // !DIAGNOSTICS: -UNUSED_PARAMETER +// IGNORE_BACKEND: JVM fun interface SuspendRunnable { suspend fun invoke() @@ -17,8 +18,7 @@ suspend fun bar3(s: String = ""): Int = 0 fun box(): String { foo1(::bar1) foo1(::bar2) - - foo1(::bar3) // Should be ambiguity + foo1(::bar3) return "OK" } diff --git a/compiler/testData/codegen/box/suspendConversion/suspendConversionWithFunInterfaces.txt b/compiler/testData/codegen/box/suspendConversion/suspendConversionWithFunInterfaces.txt deleted file mode 100644 index e3c1c2274da..00000000000 --- a/compiler/testData/codegen/box/suspendConversion/suspendConversionWithFunInterfaces.txt +++ /dev/null @@ -1,15 +0,0 @@ -package - -public fun bar1(): kotlin.Unit -public fun bar2(/*0*/ s: kotlin.String = ...): kotlin.Int -public fun bar3(): kotlin.Unit -public suspend fun bar3(/*0*/ s: kotlin.String = ...): kotlin.Int -public fun foo1(/*0*/ s: SuspendRunnable): kotlin.Unit -public fun test(): kotlin.Unit - -public fun interface SuspendRunnable { - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public abstract suspend fun invoke(): kotlin.Unit - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} diff --git a/compiler/testData/codegen/box/suspendConversion/suspendConversionWithReferenceAdaptation.kt b/compiler/testData/codegen/box/suspendConversion/suspendConversionWithReferenceAdaptation.kt index 8c0e29359c6..e9418ccb53d 100644 --- a/compiler/testData/codegen/box/suspendConversion/suspendConversionWithReferenceAdaptation.kt +++ b/compiler/testData/codegen/box/suspendConversion/suspendConversionWithReferenceAdaptation.kt @@ -1,6 +1,7 @@ // FIR_IDENTICAL // !LANGUAGE: +SuspendConversion // !DIAGNOSTICS: -UNUSED_PARAMETER +// IGNORE_BACKEND: WASM fun unitCoercion(f: suspend () -> Unit) {} fun foo(): Int = 0 diff --git a/compiler/testData/codegen/box/suspendConversion/suspendConversionWithReferenceAdaptation.txt b/compiler/testData/codegen/box/suspendConversion/suspendConversionWithReferenceAdaptation.txt deleted file mode 100644 index 391ad648b99..00000000000 --- a/compiler/testData/codegen/box/suspendConversion/suspendConversionWithReferenceAdaptation.txt +++ /dev/null @@ -1,11 +0,0 @@ -package - -public fun all(/*0*/ s: kotlin.String = ...): kotlin.Int -public fun bar(/*0*/ i: kotlin.Int, /*1*/ l: kotlin.Long = ...): kotlin.String -public fun baz(/*0*/ vararg ints: kotlin.Int /*kotlin.IntArray*/): kotlin.String -public fun defaults(/*0*/ f: suspend (kotlin.Int) -> kotlin.String): kotlin.Unit -public fun foo(): kotlin.Int -public fun test(): kotlin.Unit -public fun unitCoercion(/*0*/ f: suspend () -> kotlin.Unit): kotlin.Unit -public fun unitCoercionAndDefaults(/*0*/ f: suspend () -> kotlin.Unit): kotlin.Unit -public fun varargs(/*0*/ f: suspend (kotlin.Int, kotlin.Int, kotlin.Int) -> kotlin.String): kotlin.Unit diff --git a/compiler/testData/ir/irText/expressions/callableReferences/withAdaptationForSam.kt.txt b/compiler/testData/ir/irText/expressions/callableReferences/withAdaptationForSam.kt.txt index eb62bd54da5..657866873b6 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/withAdaptationForSam.kt.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/withAdaptationForSam.kt.txt @@ -16,7 +16,7 @@ fun test() { withVararg(xs = [p0]) /*~> Unit */ } - ::withVararg - } /*-> IFoo */) + ::withVararg /*-> IFoo */ + }) } diff --git a/compiler/testData/ir/irText/expressions/callableReferences/withAdaptationForSam.txt b/compiler/testData/ir/irText/expressions/callableReferences/withAdaptationForSam.txt index 8a109b9a2dd..9e681a8735e 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/withAdaptationForSam.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/withAdaptationForSam.txt @@ -28,13 +28,13 @@ FILE fqName: fileName:/withAdaptationForSam.kt FUN name:test visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY CALL 'public final fun useFoo (foo: .IFoo): kotlin.Unit declared in ' type=kotlin.Unit origin=null - foo: TYPE_OP type=.IFoo origin=SAM_CONVERSION typeOperand=.IFoo - BLOCK type=kotlin.Function1 origin=ADAPTED_FUNCTION_REFERENCE - FUN ADAPTER_FOR_CALLABLE_REFERENCE name:withVararg visibility:local modality:FINAL <> (p0:kotlin.Int) returnType:kotlin.Unit - VALUE_PARAMETER ADAPTER_PARAMETER_FOR_CALLABLE_REFERENCE name:p0 index:0 type:kotlin.Int - BLOCK_BODY - TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - CALL 'public final fun withVararg (vararg xs: kotlin.Int): kotlin.Int declared in ' type=kotlin.Int origin=null - xs: VARARG type=kotlin.IntArray varargElementType=kotlin.Int - GET_VAR 'p0: kotlin.Int declared in .test.withVararg' type=kotlin.Int origin=null + foo: BLOCK type=.IFoo origin=ADAPTED_FUNCTION_REFERENCE + FUN ADAPTER_FOR_CALLABLE_REFERENCE name:withVararg visibility:local modality:FINAL <> (p0:kotlin.Int) returnType:kotlin.Unit + VALUE_PARAMETER ADAPTER_PARAMETER_FOR_CALLABLE_REFERENCE name:p0 index:0 type:kotlin.Int + BLOCK_BODY + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + CALL 'public final fun withVararg (vararg xs: kotlin.Int): kotlin.Int declared in ' type=kotlin.Int origin=null + xs: VARARG type=kotlin.IntArray varargElementType=kotlin.Int + GET_VAR 'p0: kotlin.Int declared in .test.withVararg' type=kotlin.Int origin=null + TYPE_OP type=.IFoo origin=SAM_CONVERSION typeOperand=.IFoo FUNCTION_REFERENCE 'local final fun withVararg (p0: kotlin.Int): kotlin.Unit declared in .test' type=kotlin.Function1 origin=ADAPTED_FUNCTION_REFERENCE reflectionTarget=public final fun withVararg (vararg xs: kotlin.Int): kotlin.Int declared in diff --git a/compiler/testData/ir/irText/expressions/chainedFunSuspendConversionForSimpleExpression.fir.txt b/compiler/testData/ir/irText/expressions/chainedFunSuspendConversionForSimpleExpression.fir.txt new file mode 100644 index 00000000000..4c7e1ead528 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/chainedFunSuspendConversionForSimpleExpression.fir.txt @@ -0,0 +1,43 @@ +FILE fqName: fileName:/chainedFunSuspendConversionForSimpleExpression.kt + CLASS INTERFACE name:SuspendRunnable modality:ABSTRACT visibility:public [fun] superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.SuspendRunnable + FUN name:invoke visibility:public modality:ABSTRACT <> ($this:.SuspendRunnable) returnType:kotlin.Unit [suspend] + $this: VALUE_PARAMETER name: type:.SuspendRunnable + 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:foo visibility:public modality:FINAL <> (s:.SuspendRunnable) returnType:kotlin.Unit + VALUE_PARAMETER name:s index:0 type:.SuspendRunnable + BLOCK_BODY + FUN name:bar visibility:public modality:FINAL <> () returnType:kotlin.Function0 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun bar (): kotlin.Function0 declared in ' + 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 .bar' + GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit + FUN name:test visibility:public modality:FINAL <> (f:kotlin.Function0) returnType:kotlin.Unit + VALUE_PARAMETER name:f index:0 type:kotlin.Function0 + BLOCK_BODY + CALL 'public final fun foo (s: .SuspendRunnable): kotlin.Unit declared in ' type=kotlin.Unit origin=null + s: TYPE_OP type=.SuspendRunnable origin=SAM_CONVERSION typeOperand=.SuspendRunnable + GET_VAR 'f: kotlin.Function0 declared in .test' type=kotlin.Function0 origin=null + CALL 'public final fun foo (s: .SuspendRunnable): kotlin.Unit declared in ' type=kotlin.Unit origin=null + s: TYPE_OP type=.SuspendRunnable origin=SAM_CONVERSION typeOperand=.SuspendRunnable + CALL 'public final fun bar (): kotlin.Function0 declared in ' type=kotlin.Function0 origin=null + VAR name:t type:kotlin.Function0 [var] + GET_VAR 'f: kotlin.Function0 declared in .test' type=kotlin.Function0 origin=null + CALL 'public final fun foo (s: .SuspendRunnable): kotlin.Unit declared in ' type=kotlin.Unit origin=null + s: TYPE_OP type=.SuspendRunnable origin=SAM_CONVERSION typeOperand=.SuspendRunnable + GET_VAR 'var t: kotlin.Function0 [var] declared in .test' type=kotlin.Function0 origin=null diff --git a/compiler/testData/ir/irText/expressions/chainedFunSuspendConversionForSimpleExpression.kt b/compiler/testData/ir/irText/expressions/chainedFunSuspendConversionForSimpleExpression.kt new file mode 100644 index 00000000000..fe8e8f3040c --- /dev/null +++ b/compiler/testData/ir/irText/expressions/chainedFunSuspendConversionForSimpleExpression.kt @@ -0,0 +1,17 @@ +// !LANGUAGE: +SuspendConversion +// SKIP_KT_DUMP + +fun interface SuspendRunnable { + suspend fun invoke() +} + +fun foo(s: SuspendRunnable) {} + +fun bar(): () -> Unit = {} + +fun test(f: () -> Unit) { + foo(f) + foo(bar()) + var t = f + foo(t) +} diff --git a/compiler/testData/ir/irText/expressions/chainedFunSuspendConversionForSimpleExpression.txt b/compiler/testData/ir/irText/expressions/chainedFunSuspendConversionForSimpleExpression.txt new file mode 100644 index 00000000000..54f76df2046 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/chainedFunSuspendConversionForSimpleExpression.txt @@ -0,0 +1,64 @@ +FILE fqName: fileName:/chainedFunSuspendConversionForSimpleExpression.kt + CLASS INTERFACE name:SuspendRunnable modality:ABSTRACT visibility:public [fun] superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.SuspendRunnable + FUN name:invoke visibility:public modality:ABSTRACT <> ($this:.SuspendRunnable) returnType:kotlin.Unit [suspend] + $this: VALUE_PARAMETER name: type:.SuspendRunnable + 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:foo visibility:public modality:FINAL <> (s:.SuspendRunnable) returnType:kotlin.Unit + VALUE_PARAMETER name:s index:0 type:.SuspendRunnable + BLOCK_BODY + FUN name:bar visibility:public modality:FINAL <> () returnType:kotlin.Function0 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun bar (): kotlin.Function0 declared in ' + 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 .bar' + GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit + FUN name:test visibility:public modality:FINAL <> (f:kotlin.Function0) returnType:kotlin.Unit + VALUE_PARAMETER name:f index:0 type:kotlin.Function0 + BLOCK_BODY + CALL 'public final fun foo (s: .SuspendRunnable): kotlin.Unit declared in ' type=kotlin.Unit origin=null + s: BLOCK type=.SuspendRunnable origin=SUSPEND_CONVERSION + FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion0 visibility:local modality:FINAL <> ($receiver:kotlin.Function0) returnType:kotlin.Unit [suspend] + $receiver: VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:callee type:kotlin.Function0 + BLOCK_BODY + CALL 'public abstract fun invoke (): R of kotlin.Function0 [operator] declared in kotlin.Function0' type=kotlin.Unit origin=null + $this: GET_VAR 'callee: kotlin.Function0 declared in .test.suspendConversion0' type=kotlin.Function0 origin=null + TYPE_OP type=.SuspendRunnable origin=SAM_CONVERSION typeOperand=.SuspendRunnable + FUNCTION_REFERENCE 'local final fun suspendConversion0 (): kotlin.Unit [suspend] declared in .test' type=kotlin.coroutines.SuspendFunction0 origin=SUSPEND_CONVERSION reflectionTarget=null + $receiver: GET_VAR 'f: kotlin.Function0 declared in .test' type=kotlin.Function0 origin=null + CALL 'public final fun foo (s: .SuspendRunnable): kotlin.Unit declared in ' type=kotlin.Unit origin=null + s: BLOCK type=.SuspendRunnable origin=SUSPEND_CONVERSION + FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion1 visibility:local modality:FINAL <> ($receiver:kotlin.Function0) returnType:kotlin.Unit [suspend] + $receiver: VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:callee type:kotlin.Function0 + BLOCK_BODY + CALL 'public abstract fun invoke (): R of kotlin.Function0 [operator] declared in kotlin.Function0' type=kotlin.Unit origin=null + $this: GET_VAR 'callee: kotlin.Function0 declared in .test.suspendConversion1' type=kotlin.Function0 origin=null + TYPE_OP type=.SuspendRunnable origin=SAM_CONVERSION typeOperand=.SuspendRunnable + FUNCTION_REFERENCE 'local final fun suspendConversion1 (): kotlin.Unit [suspend] declared in .test' type=kotlin.coroutines.SuspendFunction0 origin=SUSPEND_CONVERSION reflectionTarget=null + $receiver: CALL 'public final fun bar (): kotlin.Function0 declared in ' type=kotlin.Function0 origin=null + VAR name:t type:kotlin.Function0 [var] + GET_VAR 'f: kotlin.Function0 declared in .test' type=kotlin.Function0 origin=null + CALL 'public final fun foo (s: .SuspendRunnable): kotlin.Unit declared in ' type=kotlin.Unit origin=null + s: BLOCK type=.SuspendRunnable origin=SUSPEND_CONVERSION + FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion2 visibility:local modality:FINAL <> ($receiver:kotlin.Function0) returnType:kotlin.Unit [suspend] + $receiver: VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:callee type:kotlin.Function0 + BLOCK_BODY + CALL 'public abstract fun invoke (): R of kotlin.Function0 [operator] declared in kotlin.Function0' type=kotlin.Unit origin=null + $this: GET_VAR 'callee: kotlin.Function0 declared in .test.suspendConversion2' type=kotlin.Function0 origin=null + TYPE_OP type=.SuspendRunnable origin=SAM_CONVERSION typeOperand=.SuspendRunnable + FUNCTION_REFERENCE 'local final fun suspendConversion2 (): kotlin.Unit [suspend] declared in .test' type=kotlin.coroutines.SuspendFunction0 origin=SUSPEND_CONVERSION reflectionTarget=null + $receiver: GET_VAR 'var t: kotlin.Function0 [var] declared in .test' type=kotlin.Function0 origin=null diff --git a/compiler/testData/ir/irText/expressions/funInterface/samConversionInVarargs.kt.txt b/compiler/testData/ir/irText/expressions/funInterface/samConversionInVarargs.kt.txt index b1b65db1e08..213228440e1 100644 --- a/compiler/testData/ir/irText/expressions/funInterface/samConversionInVarargs.kt.txt +++ b/compiler/testData/ir/irText/expressions/funInterface/samConversionInVarargs.kt.txt @@ -36,7 +36,7 @@ fun testAdaptedCR() { withVarargOfInt(xs = [p0]) /*~> Unit */ } - ::withVarargOfInt - } /*-> IFoo */]) + ::withVarargOfInt /*-> IFoo */ + }]) } diff --git a/compiler/testData/ir/irText/expressions/funInterface/samConversionInVarargs.txt b/compiler/testData/ir/irText/expressions/funInterface/samConversionInVarargs.txt index 1c3922a785f..9cee19349ad 100644 --- a/compiler/testData/ir/irText/expressions/funInterface/samConversionInVarargs.txt +++ b/compiler/testData/ir/irText/expressions/funInterface/samConversionInVarargs.txt @@ -65,13 +65,13 @@ FILE fqName: fileName:/samConversionInVarargs.kt BLOCK_BODY CALL 'public final fun useVararg (vararg foos: .IFoo): kotlin.Unit declared in ' type=kotlin.Unit origin=null foos: VARARG type=kotlin.Array.IFoo> varargElementType=.IFoo - TYPE_OP type=.IFoo origin=SAM_CONVERSION typeOperand=.IFoo - BLOCK type=kotlin.Function1 origin=ADAPTED_FUNCTION_REFERENCE - FUN ADAPTER_FOR_CALLABLE_REFERENCE name:withVarargOfInt visibility:local modality:FINAL <> (p0:kotlin.Int) returnType:kotlin.Unit - VALUE_PARAMETER ADAPTER_PARAMETER_FOR_CALLABLE_REFERENCE name:p0 index:0 type:kotlin.Int - BLOCK_BODY - TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - CALL 'public final fun withVarargOfInt (vararg xs: kotlin.Int): kotlin.String declared in ' type=kotlin.String origin=null - xs: VARARG type=kotlin.IntArray varargElementType=kotlin.Int - GET_VAR 'p0: kotlin.Int declared in .testAdaptedCR.withVarargOfInt' type=kotlin.Int origin=null + BLOCK type=.IFoo origin=ADAPTED_FUNCTION_REFERENCE + FUN ADAPTER_FOR_CALLABLE_REFERENCE name:withVarargOfInt visibility:local modality:FINAL <> (p0:kotlin.Int) returnType:kotlin.Unit + VALUE_PARAMETER ADAPTER_PARAMETER_FOR_CALLABLE_REFERENCE name:p0 index:0 type:kotlin.Int + BLOCK_BODY + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + CALL 'public final fun withVarargOfInt (vararg xs: kotlin.Int): kotlin.String declared in ' type=kotlin.String origin=null + xs: VARARG type=kotlin.IntArray varargElementType=kotlin.Int + GET_VAR 'p0: kotlin.Int declared in .testAdaptedCR.withVarargOfInt' type=kotlin.Int origin=null + TYPE_OP type=.IFoo origin=SAM_CONVERSION typeOperand=.IFoo FUNCTION_REFERENCE 'local final fun withVarargOfInt (p0: kotlin.Int): kotlin.Unit declared in .testAdaptedCR' type=kotlin.Function1 origin=ADAPTED_FUNCTION_REFERENCE reflectionTarget=public final fun withVarargOfInt (vararg xs: kotlin.Int): kotlin.String declared in diff --git a/compiler/testData/ir/irText/expressions/funInterface/samConversionOnCallableReference.kt.txt b/compiler/testData/ir/irText/expressions/funInterface/samConversionOnCallableReference.kt.txt index 08502590341..3b6113825e0 100644 --- a/compiler/testData/ir/irText/expressions/funInterface/samConversionOnCallableReference.kt.txt +++ b/compiler/testData/ir/irText/expressions/funInterface/samConversionOnCallableReference.kt.txt @@ -37,7 +37,7 @@ fun testSamConversionOnAdapted() { foo1() /*~> Unit */ } - ::foo1 - } /*-> KRunnable */) + ::foo1 /*-> KRunnable */ + }) } diff --git a/compiler/testData/ir/irText/expressions/funInterface/samConversionOnCallableReference.txt b/compiler/testData/ir/irText/expressions/funInterface/samConversionOnCallableReference.txt index 4e955691a7e..342cfd4b50a 100644 --- a/compiler/testData/ir/irText/expressions/funInterface/samConversionOnCallableReference.txt +++ b/compiler/testData/ir/irText/expressions/funInterface/samConversionOnCallableReference.txt @@ -49,10 +49,10 @@ FILE fqName: fileName:/samConversionOnCallableReference.kt FUN name:testSamConversionOnAdapted visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY CALL 'public final fun use (r: .KRunnable): kotlin.Unit declared in ' type=kotlin.Unit origin=null - r: TYPE_OP type=.KRunnable origin=SAM_CONVERSION typeOperand=.KRunnable - BLOCK type=kotlin.Function0 origin=ADAPTED_FUNCTION_REFERENCE - FUN ADAPTER_FOR_CALLABLE_REFERENCE name:foo1 visibility:local modality:FINAL <> () returnType:kotlin.Unit - BLOCK_BODY - TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - CALL 'public final fun foo1 (vararg xs: kotlin.Int): kotlin.Int declared in ' type=kotlin.Int origin=null + r: BLOCK type=.KRunnable origin=ADAPTED_FUNCTION_REFERENCE + FUN ADAPTER_FOR_CALLABLE_REFERENCE name:foo1 visibility:local modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + CALL 'public final fun foo1 (vararg xs: kotlin.Int): kotlin.Int declared in ' type=kotlin.Int origin=null + TYPE_OP type=.KRunnable origin=SAM_CONVERSION typeOperand=.KRunnable FUNCTION_REFERENCE 'local final fun foo1 (): kotlin.Unit declared in .testSamConversionOnAdapted' type=kotlin.Function0 origin=ADAPTED_FUNCTION_REFERENCE reflectionTarget=public final fun foo1 (vararg xs: kotlin.Int): kotlin.Int declared in diff --git a/compiler/testData/ir/irText/expressions/suspendConversionInVararg.fir.txt b/compiler/testData/ir/irText/expressions/suspendConversionInVararg.fir.txt new file mode 100644 index 00000000000..0014384bb95 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/suspendConversionInVararg.fir.txt @@ -0,0 +1,24 @@ +FILE fqName: fileName:/suspendConversionInVararg.kt + FUN name:useSuspendVararg visibility:public modality:FINAL <> (sfn:kotlin.Array>) returnType:kotlin.Unit + VALUE_PARAMETER name:sfn index:0 type:kotlin.Array> varargElementType:kotlin.coroutines.SuspendFunction0 [vararg] + BLOCK_BODY + FUN name:testSuspendConversionInVarargElementsSome visibility:public modality:FINAL <> (f1:kotlin.Function0, sf2:kotlin.coroutines.SuspendFunction0, f3:kotlin.Function0) returnType:kotlin.Unit + VALUE_PARAMETER name:f1 index:0 type:kotlin.Function0 + VALUE_PARAMETER name:sf2 index:1 type:kotlin.coroutines.SuspendFunction0 + VALUE_PARAMETER name:f3 index:2 type:kotlin.Function0 + BLOCK_BODY + CALL 'public final fun useSuspendVararg (vararg sfn: kotlin.coroutines.SuspendFunction0): kotlin.Unit declared in ' type=kotlin.Unit origin=null + sfn: VARARG type=kotlin.Array> varargElementType=kotlin.coroutines.SuspendFunction0 + GET_VAR 'f1: kotlin.Function0 declared in .testSuspendConversionInVarargElementsSome' type=kotlin.Function0 origin=null + GET_VAR 'sf2: kotlin.coroutines.SuspendFunction0 declared in .testSuspendConversionInVarargElementsSome' type=kotlin.coroutines.SuspendFunction0 origin=null + GET_VAR 'f3: kotlin.Function0 declared in .testSuspendConversionInVarargElementsSome' type=kotlin.Function0 origin=null + FUN name:testSuspendConversionInVarargElementsAll visibility:public modality:FINAL <> (f1:kotlin.Function0, f2:kotlin.Function0, f3:kotlin.Function0) returnType:kotlin.Unit + VALUE_PARAMETER name:f1 index:0 type:kotlin.Function0 + VALUE_PARAMETER name:f2 index:1 type:kotlin.Function0 + VALUE_PARAMETER name:f3 index:2 type:kotlin.Function0 + BLOCK_BODY + CALL 'public final fun useSuspendVararg (vararg sfn: kotlin.coroutines.SuspendFunction0): kotlin.Unit declared in ' type=kotlin.Unit origin=null + sfn: VARARG type=kotlin.Array> varargElementType=kotlin.coroutines.SuspendFunction0 + GET_VAR 'f1: kotlin.Function0 declared in .testSuspendConversionInVarargElementsAll' type=kotlin.Function0 origin=null + GET_VAR 'f2: kotlin.Function0 declared in .testSuspendConversionInVarargElementsAll' type=kotlin.Function0 origin=null + GET_VAR 'f3: kotlin.Function0 declared in .testSuspendConversionInVarargElementsAll' type=kotlin.Function0 origin=null diff --git a/compiler/testData/ir/irText/expressions/suspendConversionInVararg.kt b/compiler/testData/ir/irText/expressions/suspendConversionInVararg.kt new file mode 100644 index 00000000000..4da20e44ab3 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/suspendConversionInVararg.kt @@ -0,0 +1,20 @@ +// SKIP_KT_DUMP +// !LANGUAGE: +SuspendConversion + +fun useSuspendVararg(vararg sfn: suspend () -> Unit) {} + +fun testSuspendConversionInVarargElementsSome( + f1: () -> Unit, + sf2: suspend () -> Unit + f3: () -> Unit, +) { + useSuspendVararg(f1, sf2, f3) +} + +fun testSuspendConversionInVarargElementsAll( + f1: () -> Unit, + f2: () -> Unit, + f3: () -> Unit +) { + useSuspendVararg(f1, f2, f3) +} diff --git a/compiler/testData/ir/irText/expressions/suspendConversionInVararg.txt b/compiler/testData/ir/irText/expressions/suspendConversionInVararg.txt new file mode 100644 index 00000000000..47fed15bdeb --- /dev/null +++ b/compiler/testData/ir/irText/expressions/suspendConversionInVararg.txt @@ -0,0 +1,59 @@ +FILE fqName: fileName:/suspendConversionInVararg.kt + FUN name:useSuspendVararg visibility:public modality:FINAL <> (sfn:kotlin.Array>) returnType:kotlin.Unit + VALUE_PARAMETER name:sfn index:0 type:kotlin.Array> varargElementType:kotlin.coroutines.SuspendFunction0 [vararg] + BLOCK_BODY + FUN name:testSuspendConversionInVarargElementsSome visibility:public modality:FINAL <> (f1:kotlin.Function0, sf2:kotlin.coroutines.SuspendFunction0, f3:kotlin.Function0) returnType:kotlin.Unit + VALUE_PARAMETER name:f1 index:0 type:kotlin.Function0 + VALUE_PARAMETER name:sf2 index:1 type:kotlin.coroutines.SuspendFunction0 + VALUE_PARAMETER name:f3 index:2 type:kotlin.Function0 + BLOCK_BODY + CALL 'public final fun useSuspendVararg (vararg sfn: kotlin.coroutines.SuspendFunction0): kotlin.Unit declared in ' type=kotlin.Unit origin=null + sfn: VARARG type=kotlin.Array> varargElementType=kotlin.coroutines.SuspendFunction0 + BLOCK type=kotlin.coroutines.SuspendFunction0 origin=SUSPEND_CONVERSION + FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion0 visibility:local modality:FINAL <> ($receiver:kotlin.Function0) returnType:kotlin.Unit [suspend] + $receiver: VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:callee type:kotlin.Function0 + BLOCK_BODY + CALL 'public abstract fun invoke (): R of kotlin.Function0 [operator] declared in kotlin.Function0' type=kotlin.Unit origin=null + $this: GET_VAR 'callee: kotlin.Function0 declared in .testSuspendConversionInVarargElementsSome.suspendConversion0' type=kotlin.Function0 origin=null + FUNCTION_REFERENCE 'local final fun suspendConversion0 (): kotlin.Unit [suspend] declared in .testSuspendConversionInVarargElementsSome' type=kotlin.coroutines.SuspendFunction0 origin=SUSPEND_CONVERSION reflectionTarget=null + $receiver: GET_VAR 'f1: kotlin.Function0 declared in .testSuspendConversionInVarargElementsSome' type=kotlin.Function0 origin=null + GET_VAR 'sf2: kotlin.coroutines.SuspendFunction0 declared in .testSuspendConversionInVarargElementsSome' type=kotlin.coroutines.SuspendFunction0 origin=null + BLOCK type=kotlin.coroutines.SuspendFunction0 origin=SUSPEND_CONVERSION + FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion1 visibility:local modality:FINAL <> ($receiver:kotlin.Function0) returnType:kotlin.Unit [suspend] + $receiver: VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:callee type:kotlin.Function0 + BLOCK_BODY + CALL 'public abstract fun invoke (): R of kotlin.Function0 [operator] declared in kotlin.Function0' type=kotlin.Unit origin=null + $this: GET_VAR 'callee: kotlin.Function0 declared in .testSuspendConversionInVarargElementsSome.suspendConversion1' type=kotlin.Function0 origin=null + FUNCTION_REFERENCE 'local final fun suspendConversion1 (): kotlin.Unit [suspend] declared in .testSuspendConversionInVarargElementsSome' type=kotlin.coroutines.SuspendFunction0 origin=SUSPEND_CONVERSION reflectionTarget=null + $receiver: GET_VAR 'f3: kotlin.Function0 declared in .testSuspendConversionInVarargElementsSome' type=kotlin.Function0 origin=null + FUN name:testSuspendConversionInVarargElementsAll visibility:public modality:FINAL <> (f1:kotlin.Function0, f2:kotlin.Function0, f3:kotlin.Function0) returnType:kotlin.Unit + VALUE_PARAMETER name:f1 index:0 type:kotlin.Function0 + VALUE_PARAMETER name:f2 index:1 type:kotlin.Function0 + VALUE_PARAMETER name:f3 index:2 type:kotlin.Function0 + BLOCK_BODY + CALL 'public final fun useSuspendVararg (vararg sfn: kotlin.coroutines.SuspendFunction0): kotlin.Unit declared in ' type=kotlin.Unit origin=null + sfn: VARARG type=kotlin.Array> varargElementType=kotlin.coroutines.SuspendFunction0 + BLOCK type=kotlin.coroutines.SuspendFunction0 origin=SUSPEND_CONVERSION + FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion0 visibility:local modality:FINAL <> ($receiver:kotlin.Function0) returnType:kotlin.Unit [suspend] + $receiver: VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:callee type:kotlin.Function0 + BLOCK_BODY + CALL 'public abstract fun invoke (): R of kotlin.Function0 [operator] declared in kotlin.Function0' type=kotlin.Unit origin=null + $this: GET_VAR 'callee: kotlin.Function0 declared in .testSuspendConversionInVarargElementsAll.suspendConversion0' type=kotlin.Function0 origin=null + FUNCTION_REFERENCE 'local final fun suspendConversion0 (): kotlin.Unit [suspend] declared in .testSuspendConversionInVarargElementsAll' type=kotlin.coroutines.SuspendFunction0 origin=SUSPEND_CONVERSION reflectionTarget=null + $receiver: GET_VAR 'f1: kotlin.Function0 declared in .testSuspendConversionInVarargElementsAll' type=kotlin.Function0 origin=null + BLOCK type=kotlin.coroutines.SuspendFunction0 origin=SUSPEND_CONVERSION + FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion1 visibility:local modality:FINAL <> ($receiver:kotlin.Function0) returnType:kotlin.Unit [suspend] + $receiver: VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:callee type:kotlin.Function0 + BLOCK_BODY + CALL 'public abstract fun invoke (): R of kotlin.Function0 [operator] declared in kotlin.Function0' type=kotlin.Unit origin=null + $this: GET_VAR 'callee: kotlin.Function0 declared in .testSuspendConversionInVarargElementsAll.suspendConversion1' type=kotlin.Function0 origin=null + FUNCTION_REFERENCE 'local final fun suspendConversion1 (): kotlin.Unit [suspend] declared in .testSuspendConversionInVarargElementsAll' type=kotlin.coroutines.SuspendFunction0 origin=SUSPEND_CONVERSION reflectionTarget=null + $receiver: GET_VAR 'f2: kotlin.Function0 declared in .testSuspendConversionInVarargElementsAll' type=kotlin.Function0 origin=null + BLOCK type=kotlin.coroutines.SuspendFunction0 origin=SUSPEND_CONVERSION + FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion2 visibility:local modality:FINAL <> ($receiver:kotlin.Function0) returnType:kotlin.Unit [suspend] + $receiver: VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:callee type:kotlin.Function0 + BLOCK_BODY + CALL 'public abstract fun invoke (): R of kotlin.Function0 [operator] declared in kotlin.Function0' type=kotlin.Unit origin=null + $this: GET_VAR 'callee: kotlin.Function0 declared in .testSuspendConversionInVarargElementsAll.suspendConversion2' type=kotlin.Function0 origin=null + FUNCTION_REFERENCE 'local final fun suspendConversion2 (): kotlin.Unit [suspend] declared in .testSuspendConversionInVarargElementsAll' type=kotlin.coroutines.SuspendFunction0 origin=SUSPEND_CONVERSION reflectionTarget=null + $receiver: GET_VAR 'f3: kotlin.Function0 declared in .testSuspendConversionInVarargElementsAll' type=kotlin.Function0 origin=null diff --git a/compiler/testData/ir/irText/expressions/suspendConversionWithFunInterfaces.fir.txt b/compiler/testData/ir/irText/expressions/suspendConversionWithFunInterfaces.fir.txt new file mode 100644 index 00000000000..24566e2974a --- /dev/null +++ b/compiler/testData/ir/irText/expressions/suspendConversionWithFunInterfaces.fir.txt @@ -0,0 +1,59 @@ +FILE fqName: fileName:/suspendConversionWithFunInterfaces.kt + CLASS INTERFACE name:SuspendRunnable modality:ABSTRACT visibility:public [fun] superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.SuspendRunnable + FUN name:invoke visibility:public modality:ABSTRACT <> ($this:.SuspendRunnable) returnType:kotlin.Unit [suspend] + $this: VALUE_PARAMETER name: type:.SuspendRunnable + 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:foo1 visibility:public modality:FINAL <> (s:.SuspendRunnable) returnType:kotlin.Unit + VALUE_PARAMETER name:s index:0 type:.SuspendRunnable + BLOCK_BODY + FUN name:bar1 visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + FUN name:bar2 visibility:public modality:FINAL <> (s:kotlin.String) returnType:kotlin.Int + VALUE_PARAMETER name:s index:0 type:kotlin.String + EXPRESSION_BODY + CONST String type=kotlin.String value="" + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun bar2 (s: kotlin.String): kotlin.Int declared in ' + CONST Int type=kotlin.Int value=0 + FUN name:bar3 visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + FUN name:bar3 visibility:public modality:FINAL <> (s:kotlin.String) returnType:kotlin.Int [suspend] + VALUE_PARAMETER name:s index:0 type:kotlin.String + EXPRESSION_BODY + CONST String type=kotlin.String value="" + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun bar3 (s: kotlin.String): kotlin.Int [suspend] declared in ' + CONST Int type=kotlin.Int value=0 + FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + CALL 'public final fun foo1 (s: .SuspendRunnable): kotlin.Unit declared in ' type=kotlin.Unit origin=null + s: TYPE_OP type=.SuspendRunnable origin=SAM_CONVERSION typeOperand=.SuspendRunnable + FUN_EXPR type=kotlin.coroutines.SuspendFunction0 origin=ADAPTED_FUNCTION_REFERENCE + FUN ADAPTER_FOR_CALLABLE_REFERENCE name:bar1 visibility:local modality:FINAL <> () returnType:kotlin.Unit [suspend] + BLOCK_BODY + CALL 'public final fun bar1 (): kotlin.Unit declared in ' type=kotlin.Unit origin=null + CALL 'public final fun foo1 (s: .SuspendRunnable): kotlin.Unit declared in ' type=kotlin.Unit origin=null + s: TYPE_OP type=.SuspendRunnable origin=SAM_CONVERSION typeOperand=.SuspendRunnable + FUN_EXPR type=kotlin.coroutines.SuspendFunction0 origin=ADAPTED_FUNCTION_REFERENCE + FUN ADAPTER_FOR_CALLABLE_REFERENCE name:bar2 visibility:local modality:FINAL <> () returnType:kotlin.Unit [suspend] + BLOCK_BODY + CALL 'public final fun bar2 (s: kotlin.String): kotlin.Int declared in ' type=kotlin.Int origin=null + CALL 'public final fun foo1 (s: .SuspendRunnable): kotlin.Unit declared in ' type=kotlin.Unit origin=null + s: TYPE_OP type=.SuspendRunnable origin=SAM_CONVERSION typeOperand=.SuspendRunnable + FUN_EXPR type=kotlin.coroutines.SuspendFunction0 origin=ADAPTED_FUNCTION_REFERENCE + FUN ADAPTER_FOR_CALLABLE_REFERENCE name:bar3 visibility:local modality:FINAL <> () returnType:kotlin.Unit [suspend] + BLOCK_BODY + CALL 'public final fun bar3 (): kotlin.Unit declared in ' type=kotlin.Unit origin=null diff --git a/compiler/testData/ir/irText/expressions/suspendConversionWithFunInterfaces.kt b/compiler/testData/ir/irText/expressions/suspendConversionWithFunInterfaces.kt new file mode 100644 index 00000000000..35ba3011dd2 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/suspendConversionWithFunInterfaces.kt @@ -0,0 +1,20 @@ +// SKIP_KT_DUMP +// !LANGUAGE: +SuspendConversion + +fun interface SuspendRunnable { + suspend fun invoke() +} + +fun foo1(s: SuspendRunnable) {} +fun bar1() {} + +fun bar2(s: String = ""): Int = 0 + +fun bar3() {} +suspend fun bar3(s: String = ""): Int = 0 + +fun box() { + foo1(::bar1) + foo1(::bar2) + foo1(::bar3) +} diff --git a/compiler/testData/ir/irText/expressions/suspendConversionWithFunInterfaces.txt b/compiler/testData/ir/irText/expressions/suspendConversionWithFunInterfaces.txt new file mode 100644 index 00000000000..bd7345d93e8 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/suspendConversionWithFunInterfaces.txt @@ -0,0 +1,63 @@ +FILE fqName: fileName:/suspendConversionWithFunInterfaces.kt + CLASS INTERFACE name:SuspendRunnable modality:ABSTRACT visibility:public [fun] superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.SuspendRunnable + FUN name:invoke visibility:public modality:ABSTRACT <> ($this:.SuspendRunnable) returnType:kotlin.Unit [suspend] + $this: VALUE_PARAMETER name: type:.SuspendRunnable + 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:foo1 visibility:public modality:FINAL <> (s:.SuspendRunnable) returnType:kotlin.Unit + VALUE_PARAMETER name:s index:0 type:.SuspendRunnable + BLOCK_BODY + FUN name:bar1 visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + FUN name:bar2 visibility:public modality:FINAL <> (s:kotlin.String) returnType:kotlin.Int + VALUE_PARAMETER name:s index:0 type:kotlin.String + EXPRESSION_BODY + CONST String type=kotlin.String value="" + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun bar2 (s: kotlin.String): kotlin.Int declared in ' + CONST Int type=kotlin.Int value=0 + FUN name:bar3 visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + FUN name:bar3 visibility:public modality:FINAL <> (s:kotlin.String) returnType:kotlin.Int [suspend] + VALUE_PARAMETER name:s index:0 type:kotlin.String + EXPRESSION_BODY + CONST String type=kotlin.String value="" + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun bar3 (s: kotlin.String): kotlin.Int [suspend] declared in ' + CONST Int type=kotlin.Int value=0 + FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + CALL 'public final fun foo1 (s: .SuspendRunnable): kotlin.Unit declared in ' type=kotlin.Unit origin=null + s: BLOCK type=.SuspendRunnable origin=ADAPTED_FUNCTION_REFERENCE + FUN ADAPTER_FOR_CALLABLE_REFERENCE name:bar1 visibility:local modality:FINAL <> () returnType:kotlin.Unit [suspend] + BLOCK_BODY + CALL 'public final fun bar1 (): kotlin.Unit declared in ' type=kotlin.Unit origin=null + TYPE_OP type=.SuspendRunnable origin=SAM_CONVERSION typeOperand=.SuspendRunnable + FUNCTION_REFERENCE 'local final fun bar1 (): kotlin.Unit [suspend] declared in .box' type=kotlin.coroutines.SuspendFunction0 origin=ADAPTED_FUNCTION_REFERENCE reflectionTarget=public final fun bar1 (): kotlin.Unit declared in + CALL 'public final fun foo1 (s: .SuspendRunnable): kotlin.Unit declared in ' type=kotlin.Unit origin=null + s: BLOCK type=.SuspendRunnable origin=ADAPTED_FUNCTION_REFERENCE + FUN ADAPTER_FOR_CALLABLE_REFERENCE name:bar2 visibility:local modality:FINAL <> () returnType:kotlin.Unit [suspend] + BLOCK_BODY + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + CALL 'public final fun bar2 (s: kotlin.String): kotlin.Int declared in ' type=kotlin.Int origin=null + TYPE_OP type=.SuspendRunnable origin=SAM_CONVERSION typeOperand=.SuspendRunnable + FUNCTION_REFERENCE 'local final fun bar2 (): kotlin.Unit [suspend] declared in .box' type=kotlin.coroutines.SuspendFunction0 origin=ADAPTED_FUNCTION_REFERENCE reflectionTarget=public final fun bar2 (s: kotlin.String): kotlin.Int declared in + CALL 'public final fun foo1 (s: .SuspendRunnable): kotlin.Unit declared in ' type=kotlin.Unit origin=null + s: BLOCK type=.SuspendRunnable origin=ADAPTED_FUNCTION_REFERENCE + FUN ADAPTER_FOR_CALLABLE_REFERENCE name:bar3 visibility:local modality:FINAL <> () returnType:kotlin.Unit [suspend] + BLOCK_BODY + CALL 'public final fun bar3 (): kotlin.Unit declared in ' type=kotlin.Unit origin=null + TYPE_OP type=.SuspendRunnable origin=SAM_CONVERSION typeOperand=.SuspendRunnable + FUNCTION_REFERENCE 'local final fun bar3 (): kotlin.Unit [suspend] declared in .box' type=kotlin.coroutines.SuspendFunction0 origin=ADAPTED_FUNCTION_REFERENCE reflectionTarget=public final fun bar3 (): kotlin.Unit declared in diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ir/IrTextTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ir/IrTextTestGenerated.java index 8b004c1ed90..daaba4b5d4d 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ir/IrTextTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ir/IrTextTestGenerated.java @@ -1058,6 +1058,12 @@ public class IrTextTestGenerated extends AbstractIrTextTest { runTest("compiler/testData/ir/irText/expressions/chainOfSafeCalls.kt"); } + @Test + @TestMetadata("chainedFunSuspendConversionForSimpleExpression.kt") + public void testChainedFunSuspendConversionForSimpleExpression() throws Exception { + runTest("compiler/testData/ir/irText/expressions/chainedFunSuspendConversionForSimpleExpression.kt"); + } + @Test @TestMetadata("classReference.kt") public void testClassReference() throws Exception { @@ -1646,12 +1652,24 @@ public class IrTextTestGenerated extends AbstractIrTextTest { runTest("compiler/testData/ir/irText/expressions/stringTemplates.kt"); } + @Test + @TestMetadata("suspendConversionInVararg.kt") + public void testSuspendConversionInVararg() throws Exception { + runTest("compiler/testData/ir/irText/expressions/suspendConversionInVararg.kt"); + } + @Test @TestMetadata("suspendConversionOnArbitraryExpression.kt") public void testSuspendConversionOnArbitraryExpression() throws Exception { runTest("compiler/testData/ir/irText/expressions/suspendConversionOnArbitraryExpression.kt"); } + @Test + @TestMetadata("suspendConversionWithFunInterfaces.kt") + public void testSuspendConversionWithFunInterfaces() throws Exception { + runTest("compiler/testData/ir/irText/expressions/suspendConversionWithFunInterfaces.kt"); + } + @Test @TestMetadata("temporaryInEnumEntryInitializer.kt") public void testTemporaryInEnumEntryInitializer() throws Exception { diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index b8cb728f6af..5ec8d11b3e3 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -32899,6 +32899,46 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) public static class SuspendConversion extends AbstractLightAnalysisModeTest { + @TestMetadata("basicSuspendConversion.kt") + public void ignoreBasicSuspendConversion() throws Exception { + runTest("compiler/testData/codegen/box/suspendConversion/basicSuspendConversion.kt"); + } + + @TestMetadata("basicSuspendConversionGenerics.kt") + public void ignoreBasicSuspendConversionGenerics() throws Exception { + runTest("compiler/testData/codegen/box/suspendConversion/basicSuspendConversionGenerics.kt"); + } + + @TestMetadata("chainedFunSuspendConversionForSimpleExpression.kt") + public void ignoreChainedFunSuspendConversionForSimpleExpression() throws Exception { + runTest("compiler/testData/codegen/box/suspendConversion/chainedFunSuspendConversionForSimpleExpression.kt"); + } + + @TestMetadata("overloadResolutionBySuspendModifier.kt") + public void ignoreOverloadResolutionBySuspendModifier() throws Exception { + runTest("compiler/testData/codegen/box/suspendConversion/overloadResolutionBySuspendModifier.kt"); + } + + @TestMetadata("severalConversionsInOneCall.kt") + public void ignoreSeveralConversionsInOneCall() throws Exception { + runTest("compiler/testData/codegen/box/suspendConversion/severalConversionsInOneCall.kt"); + } + + @TestMetadata("suspendAndFunConversionInDisabledMode.kt") + public void ignoreSuspendAndFunConversionInDisabledMode() throws Exception { + runTest("compiler/testData/codegen/box/suspendConversion/suspendAndFunConversionInDisabledMode.kt"); + } + + @TestMetadata("suspendConversionOnVarargElements.kt") + public void ignoreSuspendConversionOnVarargElements() throws Exception { + runTest("compiler/testData/codegen/box/suspendConversion/suspendConversionOnVarargElements.kt"); + } + + @TestMetadata("suspendConversionWithFunInterfaces.kt") + public void ignoreSuspendConversionWithFunInterfaces() throws Exception { + runTest("compiler/testData/codegen/box/suspendConversion/suspendConversionWithFunInterfaces.kt"); + } + private void runTest(String testDataFilePath) throws Exception { KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } @@ -32907,56 +32947,16 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/suspendConversion"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } - @TestMetadata("basicSuspendConversion.kt") - public void testBasicSuspendConversion() throws Exception { - runTest("compiler/testData/codegen/box/suspendConversion/basicSuspendConversion.kt"); - } - @TestMetadata("basicSuspendConversionForCallableReference.kt") public void testBasicSuspendConversionForCallableReference() throws Exception { runTest("compiler/testData/codegen/box/suspendConversion/basicSuspendConversionForCallableReference.kt"); } - @TestMetadata("basicSuspendConversionGenerics.kt") - public void testBasicSuspendConversionGenerics() throws Exception { - runTest("compiler/testData/codegen/box/suspendConversion/basicSuspendConversionGenerics.kt"); - } - - @TestMetadata("chainedFunSuspendConversionForSimpleExpression.kt") - public void testChainedFunSuspendConversionForSimpleExpression() throws Exception { - runTest("compiler/testData/codegen/box/suspendConversion/chainedFunSuspendConversionForSimpleExpression.kt"); - } - - @TestMetadata("overloadResolutionBySuspendModifier.kt") - public void testOverloadResolutionBySuspendModifier() throws Exception { - runTest("compiler/testData/codegen/box/suspendConversion/overloadResolutionBySuspendModifier.kt"); - } - - @TestMetadata("severalConversionsInOneCall.kt") - public void testSeveralConversionsInOneCall() throws Exception { - runTest("compiler/testData/codegen/box/suspendConversion/severalConversionsInOneCall.kt"); - } - - @TestMetadata("suspendAndFunConversionInDisabledMode.kt") - public void testSuspendAndFunConversionInDisabledMode() throws Exception { - runTest("compiler/testData/codegen/box/suspendConversion/suspendAndFunConversionInDisabledMode.kt"); - } - @TestMetadata("suspendConversionCompatibility.kt") public void testSuspendConversionCompatibility() throws Exception { runTest("compiler/testData/codegen/box/suspendConversion/suspendConversionCompatibility.kt"); } - @TestMetadata("suspendConversionOnVarargElements.kt") - public void testSuspendConversionOnVarargElements() throws Exception { - runTest("compiler/testData/codegen/box/suspendConversion/suspendConversionOnVarargElements.kt"); - } - - @TestMetadata("suspendConversionWithFunInterfaces.kt") - public void testSuspendConversionWithFunInterfaces() throws Exception { - runTest("compiler/testData/codegen/box/suspendConversion/suspendConversionWithFunInterfaces.kt"); - } - @TestMetadata("suspendConversionWithReferenceAdaptation.kt") public void testSuspendConversionWithReferenceAdaptation() throws Exception { runTest("compiler/testData/codegen/box/suspendConversion/suspendConversionWithReferenceAdaptation.kt"); diff --git a/compiler/tests-gen/org/jetbrains/kotlin/ir/KlibTextTestCaseGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/ir/KlibTextTestCaseGenerated.java index e10f624a60a..266b27f5ca0 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/ir/KlibTextTestCaseGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/ir/KlibTextTestCaseGenerated.java @@ -868,6 +868,11 @@ public class KlibTextTestCaseGenerated extends AbstractKlibTextTestCase { runTest("compiler/testData/ir/irText/expressions/chainOfSafeCalls.kt"); } + @TestMetadata("chainedFunSuspendConversionForSimpleExpression.kt") + public void testChainedFunSuspendConversionForSimpleExpression() throws Exception { + runTest("compiler/testData/ir/irText/expressions/chainedFunSuspendConversionForSimpleExpression.kt"); + } + @TestMetadata("complexAugmentedAssignment.kt") public void testComplexAugmentedAssignment() throws Exception { runTest("compiler/testData/ir/irText/expressions/complexAugmentedAssignment.kt"); @@ -1258,11 +1263,21 @@ public class KlibTextTestCaseGenerated extends AbstractKlibTextTestCase { runTest("compiler/testData/ir/irText/expressions/stringTemplates.kt"); } + @TestMetadata("suspendConversionInVararg.kt") + public void testSuspendConversionInVararg() throws Exception { + runTest("compiler/testData/ir/irText/expressions/suspendConversionInVararg.kt"); + } + @TestMetadata("suspendConversionOnArbitraryExpression.kt") public void testSuspendConversionOnArbitraryExpression() throws Exception { runTest("compiler/testData/ir/irText/expressions/suspendConversionOnArbitraryExpression.kt"); } + @TestMetadata("suspendConversionWithFunInterfaces.kt") + public void testSuspendConversionWithFunInterfaces() throws Exception { + runTest("compiler/testData/ir/irText/expressions/suspendConversionWithFunInterfaces.kt"); + } + @TestMetadata("temporaryInEnumEntryInitializer.kt") public void testTemporaryInEnumEntryInitializer() throws Exception { runTest("compiler/testData/ir/irText/expressions/temporaryInEnumEntryInitializer.kt"); diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java index 5ed187b418c..3da02bacf90 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java @@ -27532,11 +27532,6 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes runTest("compiler/testData/codegen/box/suspendConversion/basicSuspendConversionForCallableReference.kt"); } - @TestMetadata("basicSuspendConversionGenerics.kt") - public void testBasicSuspendConversionGenerics() throws Exception { - runTest("compiler/testData/codegen/box/suspendConversion/basicSuspendConversionGenerics.kt"); - } - @TestMetadata("chainedFunSuspendConversionForSimpleExpression.kt") public void testChainedFunSuspendConversionForSimpleExpression() throws Exception { runTest("compiler/testData/codegen/box/suspendConversion/chainedFunSuspendConversionForSimpleExpression.kt"); diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java index 293d7a0e57b..a45d0c07faf 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java @@ -26938,11 +26938,6 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { runTest("compiler/testData/codegen/box/suspendConversion/basicSuspendConversionForCallableReference.kt"); } - @TestMetadata("basicSuspendConversionGenerics.kt") - public void testBasicSuspendConversionGenerics() throws Exception { - runTest("compiler/testData/codegen/box/suspendConversion/basicSuspendConversionGenerics.kt"); - } - @TestMetadata("chainedFunSuspendConversionForSimpleExpression.kt") public void testChainedFunSuspendConversionForSimpleExpression() throws Exception { runTest("compiler/testData/codegen/box/suspendConversion/chainedFunSuspendConversionForSimpleExpression.kt"); diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java index 84d94cbc1c7..66d3e603eef 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java @@ -26898,11 +26898,6 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { runTest("compiler/testData/codegen/box/suspendConversion/basicSuspendConversionForCallableReference.kt"); } - @TestMetadata("basicSuspendConversionGenerics.kt") - public void testBasicSuspendConversionGenerics() throws Exception { - runTest("compiler/testData/codegen/box/suspendConversion/basicSuspendConversionGenerics.kt"); - } - @TestMetadata("chainedFunSuspendConversionForSimpleExpression.kt") public void testChainedFunSuspendConversionForSimpleExpression() throws Exception { runTest("compiler/testData/codegen/box/suspendConversion/chainedFunSuspendConversionForSimpleExpression.kt"); diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java index f16de973deb..1680b92d87d 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java @@ -15059,11 +15059,6 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest runTest("compiler/testData/codegen/box/suspendConversion/basicSuspendConversionForCallableReference.kt"); } - @TestMetadata("basicSuspendConversionGenerics.kt") - public void testBasicSuspendConversionGenerics() throws Exception { - runTest("compiler/testData/codegen/box/suspendConversion/basicSuspendConversionGenerics.kt"); - } - @TestMetadata("chainedFunSuspendConversionForSimpleExpression.kt") public void testChainedFunSuspendConversionForSimpleExpression() throws Exception { runTest("compiler/testData/codegen/box/suspendConversion/chainedFunSuspendConversionForSimpleExpression.kt");