diff --git a/compiler/fir/analysis-tests/legacy-fir-tests/tests-gen/org/jetbrains/kotlin/fir/FirLoadCompiledKotlinGenerated.java b/compiler/fir/analysis-tests/legacy-fir-tests/tests-gen/org/jetbrains/kotlin/fir/FirLoadCompiledKotlinGenerated.java index 9f28f9c4807..f0f65e6dfc8 100644 --- a/compiler/fir/analysis-tests/legacy-fir-tests/tests-gen/org/jetbrains/kotlin/fir/FirLoadCompiledKotlinGenerated.java +++ b/compiler/fir/analysis-tests/legacy-fir-tests/tests-gen/org/jetbrains/kotlin/fir/FirLoadCompiledKotlinGenerated.java @@ -1000,6 +1000,11 @@ public class FirLoadCompiledKotlinGenerated extends AbstractFirLoadCompiledKotli public void testBasic() throws Exception { runTest("compiler/testData/loadJava/compiledKotlin/coroutines/Basic.kt"); } + + @TestMetadata("TypeAliasFTSuspendWithReceiver.kt") + public void testTypeAliasFTSuspendWithReceiver() throws Exception { + runTest("compiler/testData/loadJava/compiledKotlin/coroutines/TypeAliasFTSuspendWithReceiver.kt"); + } } @TestMetadata("compiler/testData/loadJava/compiledKotlin/dataClass") diff --git a/compiler/fir/analysis-tests/testData/loadCompiledKotlin/coroutines/TypeAliasFTSuspendWithReceiver.txt b/compiler/fir/analysis-tests/testData/loadCompiledKotlin/coroutines/TypeAliasFTSuspendWithReceiver.txt new file mode 100644 index 00000000000..543e6e98068 --- /dev/null +++ b/compiler/fir/analysis-tests/testData/loadCompiledKotlin/coroutines/TypeAliasFTSuspendWithReceiver.txt @@ -0,0 +1,9 @@ +public final fun foo(f: R|suspend test/Context.() -> kotlin/Unit|): R|kotlin/Unit| + +public final class Context : R|kotlin/Any| { + public constructor(): R|test/Context| + +} + +public final typealias SuspendWithContext = R|suspend test/Context.() -> kotlin/Unit| + diff --git a/compiler/fir/providers/src/org/jetbrains/kotlin/fir/types/InferenceUtils.kt b/compiler/fir/providers/src/org/jetbrains/kotlin/fir/types/InferenceUtils.kt index e7e43162466..2512a47d8d2 100644 --- a/compiler/fir/providers/src/org/jetbrains/kotlin/fir/types/InferenceUtils.kt +++ b/compiler/fir/providers/src/org/jetbrains/kotlin/fir/types/InferenceUtils.kt @@ -123,7 +123,7 @@ fun ConeKotlinType.suspendFunctionTypeToFunctionTypeWithContinuation(session: Fi isNullable = false ) + lastTypeArgument).toTypedArray(), isNullable = false, - attributes = attributes + attributes = fullyExpandedType.attributes ) } diff --git a/compiler/testData/loadJava/compiledKotlin/coroutines/TypeAliasFTSuspendWithReceiver.kt b/compiler/testData/loadJava/compiledKotlin/coroutines/TypeAliasFTSuspendWithReceiver.kt new file mode 100644 index 00000000000..19394a621d5 --- /dev/null +++ b/compiler/testData/loadJava/compiledKotlin/coroutines/TypeAliasFTSuspendWithReceiver.kt @@ -0,0 +1,9 @@ +// NO_CHECK_SOURCE_VS_BINARY +// Type-alias info is lost during serialization in K1 +package test + +class Context + +typealias SuspendWithContext = suspend Context.() -> Unit + +fun foo(f: SuspendWithContext) {} \ No newline at end of file diff --git a/compiler/testData/loadJava/compiledKotlin/coroutines/TypeAliasFTSuspendWithReceiver.txt b/compiler/testData/loadJava/compiledKotlin/coroutines/TypeAliasFTSuspendWithReceiver.txt new file mode 100644 index 00000000000..b319e284ce8 --- /dev/null +++ b/compiler/testData/loadJava/compiledKotlin/coroutines/TypeAliasFTSuspendWithReceiver.txt @@ -0,0 +1,8 @@ +package test + +public fun foo(/*0*/ f: suspend test.Context.() -> kotlin.Unit): kotlin.Unit + +public final class Context { + /*primary*/ public constructor Context() +} +public typealias SuspendWithContext = suspend test.Context.() -> kotlin.Unit diff --git a/compiler/tests-gen/org/jetbrains/kotlin/jvm/compiler/LoadJavaTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/jvm/compiler/LoadJavaTestGenerated.java index cfdc068acd7..2cca4980846 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/jvm/compiler/LoadJavaTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/jvm/compiler/LoadJavaTestGenerated.java @@ -2678,6 +2678,11 @@ public class LoadJavaTestGenerated extends AbstractLoadJavaTest { public void testBasic() throws Exception { runTest("compiler/testData/loadJava/compiledKotlin/coroutines/Basic.kt"); } + + @TestMetadata("TypeAliasFTSuspendWithReceiver.kt") + public void testTypeAliasFTSuspendWithReceiver() throws Exception { + runTest("compiler/testData/loadJava/compiledKotlin/coroutines/TypeAliasFTSuspendWithReceiver.kt"); + } } @TestMetadata("compiler/testData/loadJava/compiledKotlin/dataClass") diff --git a/compiler/tests-gen/org/jetbrains/kotlin/jvm/compiler/LoadKotlinWithTypeTableTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/jvm/compiler/LoadKotlinWithTypeTableTestGenerated.java index 0d5f97d281a..cb3dd0b24dc 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/jvm/compiler/LoadKotlinWithTypeTableTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/jvm/compiler/LoadKotlinWithTypeTableTestGenerated.java @@ -1000,6 +1000,11 @@ public class LoadKotlinWithTypeTableTestGenerated extends AbstractLoadKotlinWith public void testBasic() throws Exception { runTest("compiler/testData/loadJava/compiledKotlin/coroutines/Basic.kt"); } + + @TestMetadata("TypeAliasFTSuspendWithReceiver.kt") + public void testTypeAliasFTSuspendWithReceiver() throws Exception { + runTest("compiler/testData/loadJava/compiledKotlin/coroutines/TypeAliasFTSuspendWithReceiver.kt"); + } } @TestMetadata("compiler/testData/loadJava/compiledKotlin/dataClass") diff --git a/compiler/tests-gen/org/jetbrains/kotlin/jvm/compiler/ir/IrLoadJavaTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/jvm/compiler/ir/IrLoadJavaTestGenerated.java index 922edfb5020..3081237d691 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/jvm/compiler/ir/IrLoadJavaTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/jvm/compiler/ir/IrLoadJavaTestGenerated.java @@ -2679,6 +2679,11 @@ public class IrLoadJavaTestGenerated extends AbstractIrLoadJavaTest { public void testBasic() throws Exception { runTest("compiler/testData/loadJava/compiledKotlin/coroutines/Basic.kt"); } + + @TestMetadata("TypeAliasFTSuspendWithReceiver.kt") + public void testTypeAliasFTSuspendWithReceiver() throws Exception { + runTest("compiler/testData/loadJava/compiledKotlin/coroutines/TypeAliasFTSuspendWithReceiver.kt"); + } } @TestMetadata("compiler/testData/loadJava/compiledKotlin/dataClass") diff --git a/compiler/tests-gen/org/jetbrains/kotlin/jvm/compiler/javac/LoadJavaUsingJavacTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/jvm/compiler/javac/LoadJavaUsingJavacTestGenerated.java index 196b54237ce..2f94b3319de 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/jvm/compiler/javac/LoadJavaUsingJavacTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/jvm/compiler/javac/LoadJavaUsingJavacTestGenerated.java @@ -2678,6 +2678,11 @@ public class LoadJavaUsingJavacTestGenerated extends AbstractLoadJavaUsingJavacT public void testBasic() throws Exception { runTest("compiler/testData/loadJava/compiledKotlin/coroutines/Basic.kt"); } + + @TestMetadata("TypeAliasFTSuspendWithReceiver.kt") + public void testTypeAliasFTSuspendWithReceiver() throws Exception { + runTest("compiler/testData/loadJava/compiledKotlin/coroutines/TypeAliasFTSuspendWithReceiver.kt"); + } } @TestMetadata("compiler/testData/loadJava/compiledKotlin/dataClass") diff --git a/core/descriptors.runtime/tests/org/jetbrains/kotlin/jvm/runtime/JvmRuntimeDescriptorLoaderTestGenerated.java b/core/descriptors.runtime/tests/org/jetbrains/kotlin/jvm/runtime/JvmRuntimeDescriptorLoaderTestGenerated.java index 025ab0aa642..425b5036587 100644 --- a/core/descriptors.runtime/tests/org/jetbrains/kotlin/jvm/runtime/JvmRuntimeDescriptorLoaderTestGenerated.java +++ b/core/descriptors.runtime/tests/org/jetbrains/kotlin/jvm/runtime/JvmRuntimeDescriptorLoaderTestGenerated.java @@ -1002,6 +1002,11 @@ public class JvmRuntimeDescriptorLoaderTestGenerated extends AbstractJvmRuntimeD public void testBasic() throws Exception { runTest("compiler/testData/loadJava/compiledKotlin/coroutines/Basic.kt"); } + + @TestMetadata("TypeAliasFTSuspendWithReceiver.kt") + public void testTypeAliasFTSuspendWithReceiver() throws Exception { + runTest("compiler/testData/loadJava/compiledKotlin/coroutines/TypeAliasFTSuspendWithReceiver.kt"); + } } @TestMetadata("compiler/testData/loadJava/compiledKotlin/dataClass")