diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/coroutines/CoroutineTransformerMethodVisitor.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/coroutines/CoroutineTransformerMethodVisitor.kt index 7267e9b2c3d..ee7976dec9d 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/coroutines/CoroutineTransformerMethodVisitor.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/coroutines/CoroutineTransformerMethodVisitor.kt @@ -284,7 +284,7 @@ class CoroutineTransformerMethodVisitor( variablesMapping.forEach { v.visit(null, it.variableName) } }.visitEnd() metadata.visit(COROUTINES_METADATA_METHOD_NAME_JVM_NAME, methodNode.name) - metadata.visit(COROUTINES_METADATA_CLASS_NAME_JVM_NAME, containingClassInternalName) + metadata.visit(COROUTINES_METADATA_CLASS_NAME_JVM_NAME, Type.getObjectType(containingClassInternalName).className) @Suppress("ConstantConditionIf") if (COROUTINES_DEBUG_METADATA_VERSION != 1) { metadata.visit(COROUTINES_METADATA_VERSION_JVM_NAME, COROUTINES_DEBUG_METADATA_VERSION) diff --git a/compiler/testData/codegen/box/coroutines/debug/fqName.kt b/compiler/testData/codegen/box/coroutines/debug/fqName.kt new file mode 100644 index 00000000000..e5235f85926 --- /dev/null +++ b/compiler/testData/codegen/box/coroutines/debug/fqName.kt @@ -0,0 +1,41 @@ +// !LANGUAGE: +ReleaseCoroutines + +// IGNORE_BACKEND: JVM_IR +// TARGET_BACKEND: JVM +// WITH_RUNTIME +// FULL_JDK +// WITH_COROUTINES + +@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER", "CANNOT_OVERRIDE_INVISIBLE_MEMBER") + +package some.long.name + +import helpers.* +import kotlin.coroutines.* +import kotlin.coroutines.intrinsics.* +import kotlin.coroutines.jvm.internal.* + +suspend fun dummy() {} + +class Test { + suspend fun getStackTraceElement(): StackTraceElement { + dummy() // to force state-machine generation + return suspendCoroutineUninterceptedOrReturn { + (it as BaseContinuationImpl).getStackTraceElement() + } + } +} + +fun builder(c: suspend () -> Unit) { + c.startCoroutine(EmptyContinuation) +} + +fun box(): String { + var res = "OK" + builder { + if (Test().getStackTraceElement().className != "some.long.name.Test") { + res = Test().getStackTraceElement().className + } + } + return res +} diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java index b7a6f74c168..18babfc22d2 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java @@ -6592,6 +6592,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/coroutines/debug/firstSuspensionPoint.kt"); } + @TestMetadata("fqName.kt") + public void testFqName() throws Exception { + runTest("compiler/testData/codegen/box/coroutines/debug/fqName.kt"); + } + @TestMetadata("runtimeDebugMetadata.kt") public void testRuntimeDebugMetadata() throws Exception { runTest("compiler/testData/codegen/box/coroutines/debug/runtimeDebugMetadata.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index 9c5a4e4759b..ddf3e245513 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -6592,6 +6592,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/coroutines/debug/firstSuspensionPoint.kt"); } + @TestMetadata("fqName.kt") + public void testFqName() throws Exception { + runTest("compiler/testData/codegen/box/coroutines/debug/fqName.kt"); + } + @TestMetadata("runtimeDebugMetadata.kt") public void testRuntimeDebugMetadata() throws Exception { runTest("compiler/testData/codegen/box/coroutines/debug/runtimeDebugMetadata.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java index 226e111092b..55171650e29 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java @@ -6592,6 +6592,11 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/coroutines/debug/firstSuspensionPoint.kt"); } + @TestMetadata("fqName.kt") + public void testFqName() throws Exception { + runTest("compiler/testData/codegen/box/coroutines/debug/fqName.kt"); + } + @TestMetadata("runtimeDebugMetadata.kt") public void testRuntimeDebugMetadata() throws Exception { runTest("compiler/testData/codegen/box/coroutines/debug/runtimeDebugMetadata.kt");