diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/state/KotlinTypeMapper.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/state/KotlinTypeMapper.java index 1628f7fcb94..31187557e96 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/state/KotlinTypeMapper.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/state/KotlinTypeMapper.java @@ -1027,6 +1027,10 @@ public class KotlinTypeMapper { } } + if (f instanceof TypeAliasConstructorDescriptor) { + return mapSignature(((TypeAliasConstructorDescriptor) f).getUnderlyingConstructorDescriptor(), kind, skipGenericSignature); + } + if (CoroutineCodegenUtilKt.isSuspendFunctionNotSuspensionView(f)) { return mapSignature(CoroutineCodegenUtilKt.getOrCreateJvmSuspendFunctionView(f), kind, skipGenericSignature); } @@ -1048,9 +1052,6 @@ public class KotlinTypeMapper { if (f instanceof FunctionImportedFromObject) { return mapSignature(((FunctionImportedFromObject) f).getCallableFromObject(), kind, skipGenericSignature); } - else if (f instanceof TypeAliasConstructorDescriptor) { - return mapSignatureWithCustomParameters(((TypeAliasConstructorDescriptor) f).getUnderlyingConstructorDescriptor(), kind, valueParameters, skipGenericSignature); - } checkOwnerCompatibility(f); diff --git a/compiler/testData/codegen/box/typealias/objectLiteralConstructor.kt b/compiler/testData/codegen/box/typealias/objectLiteralConstructor.kt new file mode 100644 index 00000000000..eab3abf7d1d --- /dev/null +++ b/compiler/testData/codegen/box/typealias/objectLiteralConstructor.kt @@ -0,0 +1,10 @@ +open class LockFreeLinkedListNode(val s: String) +private class SendBuffered(s: String) : LockFreeLinkedListNode(s) +open class AddLastDesc2(val node: T) +typealias AddLastDesc = AddLastDesc2 + +fun describeSendBuffered(): AddLastDesc<*> { + return object : AddLastDesc(SendBuffered("OK")) {} +} + +fun box() = describeSendBuffered().node.s diff --git a/compiler/testData/codegen/light-analysis/typealias/objectLiteralConstructor.txt b/compiler/testData/codegen/light-analysis/typealias/objectLiteralConstructor.txt new file mode 100644 index 00000000000..f42fbb1f1b4 --- /dev/null +++ b/compiler/testData/codegen/light-analysis/typealias/objectLiteralConstructor.txt @@ -0,0 +1,24 @@ +@kotlin.Metadata +public class AddLastDesc2 { + private final @org.jetbrains.annotations.NotNull field node: LockFreeLinkedListNode + public method (@org.jetbrains.annotations.NotNull p0: LockFreeLinkedListNode): void + public final @org.jetbrains.annotations.NotNull method getNode(): LockFreeLinkedListNode +} + +@kotlin.Metadata +public class LockFreeLinkedListNode { + private final @org.jetbrains.annotations.NotNull field s: java.lang.String + public method (@org.jetbrains.annotations.NotNull p0: java.lang.String): void + public final @org.jetbrains.annotations.NotNull method getS(): java.lang.String +} + +@kotlin.Metadata +public final class ObjectLiteralConstructorKt { + public final static @org.jetbrains.annotations.NotNull method box(): java.lang.String + public final static @org.jetbrains.annotations.NotNull method describeSendBuffered(): AddLastDesc2 +} + +@kotlin.Metadata +final class SendBuffered { + public method (@org.jetbrains.annotations.NotNull p0: java.lang.String): void +} diff --git a/compiler/tests-ir-jvm/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java b/compiler/tests-ir-jvm/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java index 53ed1cc4e92..8a4770dca4f 100644 --- a/compiler/tests-ir-jvm/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests-ir-jvm/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java @@ -17699,6 +17699,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes doTest(fileName); } + @TestMetadata("objectLiteralConstructor.kt") + public void testObjectLiteralConstructor() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/typealias/objectLiteralConstructor.kt"); + doTest(fileName); + } + @TestMetadata("simple.kt") public void testSimple() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/typealias/simple.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java index a37bc916147..6031d2b43c3 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java @@ -17699,6 +17699,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { doTest(fileName); } + @TestMetadata("objectLiteralConstructor.kt") + public void testObjectLiteralConstructor() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/typealias/objectLiteralConstructor.kt"); + doTest(fileName); + } + @TestMetadata("simple.kt") public void testSimple() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/typealias/simple.kt"); diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java index 6e52997d961..009ddf14154 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java @@ -21904,6 +21904,12 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { doTest(fileName); } + @TestMetadata("objectLiteralConstructor.kt") + public void testObjectLiteralConstructor() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/typealias/objectLiteralConstructor.kt"); + doTest(fileName); + } + @TestMetadata("simple.kt") public void testSimple() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/typealias/simple.kt");