39 lines
741 B
Kotlin
Vendored
39 lines
741 B
Kotlin
Vendored
// IGNORE_BACKEND: JS, JS_IR, WASM
|
|
// IGNORE_BACKEND: JS_IR_ES6
|
|
// FULL_JDK
|
|
// WITH_STDLIB
|
|
// WASM_MUTE_REASON: IGNORED_IN_JS
|
|
// WORKS_WHEN_VALUE_CLASS
|
|
// LANGUAGE: +ValueClasses, +GenericInlineClassParameter
|
|
|
|
OPTIONAL_JVM_INLINE_ANNOTATION
|
|
value class Id<T: String>(val id: T)
|
|
|
|
fun throws() {
|
|
throw RuntimeException()
|
|
}
|
|
|
|
fun test(id: Id<String>) {
|
|
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())
|
|
} |