Files
kotlin/compiler/testData/codegen/box/inlineClasses/functionNameMangling/mangledFunctionsPresentInStackTrace.kt
2020-11-09 16:04:43 +03:00

38 lines
686 B
Kotlin
Vendored

// DONT_TARGET_EXACT_BACKEND: WASM
// WASM_MUTE_REASON: EXCEPTIONS_NOT_IMPLEMENTED
// !LANGUAGE: +InlineClasses
// IGNORE_BACKEND: JS, JS_IR
// IGNORE_BACKEND: JS_IR_ES6
// 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())
}