Files
kotlin/compiler/testData/codegen/box/inlineClasses/functionNameMangling/mangledFunctionsPresentInStackTrace.kt
Dmitry Petrov 99498eb7b8 Use 'name-hash' mangling scheme
'-' is allowed as a name character both in JVM and in Dalvik, but can't
be a part of a Java identifier.
2018-08-30 14:58:52 +03:00

35 lines
582 B
Kotlin
Vendored

// !LANGUAGE: +InlineClasses
// IGNORE_BACKEND: JVM_IR, JS, JS_IR
// FULL_JDK
// WITH_RUNTIME
inline class Id(val id: String)
fun throws() {
throw RuntimeException()
}
fun test(id: Id) {
throws()
}
fun foo() {
test(Id("id"))
}
fun box(): String {
val stackTrace = try {
foo()
throw AssertionError()
} catch (e: RuntimeException) {
e.stackTrace
}
for (entry in stackTrace) {
if (entry.methodName.startsWith("test")) {
return "OK"
}
}
throw AssertionError(stackTrace.asList().toString())
}