Use class name instead internal name in coroutines debug metadata

I.e. instead of slashes use dots in fqnames.

 #KT-28237 Fixed
This commit is contained in:
Ilmir Usmanov
2018-11-20 15:21:02 +03:00
parent 5483ce0933
commit bdd1eef39a
5 changed files with 57 additions and 1 deletions
@@ -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<StackTraceElement> {
(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
}