mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-09 00:21:47 +00:00
Includes changes to decompiled text Old syntax is used in builtins and project code for now
34 lines
832 B
Kotlin
34 lines
832 B
Kotlin
package foo
|
|
|
|
import kotlin.jvm.*
|
|
import kotlin.platform.*
|
|
|
|
class WithNative {
|
|
default object {
|
|
platformStatic native fun bar(l: Long, s: String): Double
|
|
}
|
|
}
|
|
|
|
object ObjWithNative {
|
|
platformStatic native fun bar(l: Long, s: String): Double
|
|
}
|
|
|
|
fun box(): String {
|
|
var d = 0.0
|
|
try {
|
|
d = WithNative.bar(1, "")
|
|
return "Link error expected"
|
|
}
|
|
catch (e: java.lang.UnsatisfiedLinkError) {
|
|
if (e.getMessage() != "foo.WithNative.bar(JLjava/lang/String;)D") return "Fail 1: " + e.getMessage()
|
|
}
|
|
|
|
try {
|
|
d = ObjWithNative.bar(1, "")
|
|
return "Link error expected on object"
|
|
}
|
|
catch (e: java.lang.UnsatisfiedLinkError) {
|
|
if (e.getMessage() != "foo.ObjWithNative.bar(JLjava/lang/String;)D") return "Fail 2: " + e.getMessage()
|
|
}
|
|
return "OK"
|
|
} |