mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-16 08:31:35 +00:00
Instead of non-existing `kotlin.KotlinPackage`, which led to NoClassDefFoundError as soon as reflection tried to call getOwner on a builtin callable reference, use a reference to a new physical class `kotlin.jvm.internal.Intrinsics$Kotlin`. This will allow to support KT-17151. Note that for API version less than 1.4, this will still lead to NoClassDefFoundError, but this is not worse than the current situation where it happens anyway.
13 lines
337 B
Kotlin
Vendored
13 lines
337 B
Kotlin
Vendored
// TARGET_BACKEND: JVM
|
|
// IGNORE_BACKEND_FIR: JVM_IR
|
|
// WITH_RUNTIME
|
|
|
|
fun box(): String {
|
|
val f = Any?::toString
|
|
|
|
val owner = (f as kotlin.jvm.internal.CallableReference).owner as kotlin.jvm.internal.PackageReference
|
|
if (owner.jClass.name != "kotlin.jvm.internal.Intrinsics\$Kotlin") return "Fail: $owner"
|
|
|
|
return "OK"
|
|
}
|