Support native top-level functions
This commit is contained in:
@@ -9,6 +9,8 @@ object ObjWithNative {
|
||||
platformStatic native fun bar(l: Long, s: String = ""): Double
|
||||
}
|
||||
|
||||
native fun topLevel(x: Int = 1): Double
|
||||
|
||||
fun box(): String {
|
||||
var d = 0.0
|
||||
|
||||
@@ -27,5 +29,13 @@ fun box(): String {
|
||||
catch (e: java.lang.UnsatisfiedLinkError) {
|
||||
if (e.getMessage() != "foo.ObjWithNative.foo(I)D") return "Fail 2: " + e.getMessage()
|
||||
}
|
||||
|
||||
try {
|
||||
d = topLevel()
|
||||
return "Link error expected on object"
|
||||
}
|
||||
catch (e: java.lang.UnsatisfiedLinkError) {
|
||||
if (e.getMessage() != "foo.FooPackage.topLevel(I)D") return "Fail 3: " + e.getMessage()
|
||||
}
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user