Add kotlin.external annotation and deprecate kotlin.jvm.native
This commit is contained in:
@@ -4,12 +4,12 @@ import kotlin.jvm.*
|
||||
import kotlin.platform.*
|
||||
|
||||
object ObjWithNative {
|
||||
native fun foo(x: Int = 1): Double
|
||||
external fun foo(x: Int = 1): Double
|
||||
|
||||
platformStatic native fun bar(l: Long, s: String = ""): Double
|
||||
platformStatic external fun bar(l: Long, s: String = ""): Double
|
||||
}
|
||||
|
||||
native fun topLevel(x: Int = 1): Double
|
||||
external fun topLevel(x: Int = 1): Double
|
||||
|
||||
fun box(): String {
|
||||
var d = 0.0
|
||||
|
||||
+9
-9
@@ -1,27 +1,27 @@
|
||||
class C {
|
||||
companion object {
|
||||
val defaultGetter: Int = 1
|
||||
@native get
|
||||
@external get
|
||||
|
||||
var defaultSetter: Int = 1
|
||||
@native get
|
||||
@native set
|
||||
@external get
|
||||
@external set
|
||||
}
|
||||
|
||||
val defaultGetter: Int = 1
|
||||
@native get
|
||||
@external get
|
||||
|
||||
var defaultSetter: Int = 1
|
||||
@native get
|
||||
@native set
|
||||
@external get
|
||||
@external set
|
||||
}
|
||||
|
||||
val defaultGetter: Int = 1
|
||||
@native get
|
||||
@external get
|
||||
|
||||
var defaultSetter: Int = 1
|
||||
@native get
|
||||
@native set
|
||||
@external get
|
||||
@external set
|
||||
|
||||
fun check(body: () -> Unit, signature: String): String? {
|
||||
try {
|
||||
|
||||
@@ -3,7 +3,7 @@ import kotlin.platform.*
|
||||
|
||||
class C {
|
||||
companion object {
|
||||
private platformStatic native fun foo()
|
||||
private platformStatic external fun foo()
|
||||
}
|
||||
|
||||
fun bar() {
|
||||
|
||||
@@ -3,7 +3,7 @@ package foo
|
||||
import kotlin.jvm.*
|
||||
|
||||
class WithNative {
|
||||
native fun foo()
|
||||
external fun foo()
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
|
||||
@@ -5,12 +5,12 @@ import kotlin.platform.*
|
||||
|
||||
class WithNative {
|
||||
companion object {
|
||||
platformStatic native fun bar(l: Long, s: String): Double
|
||||
platformStatic external fun bar(l: Long, s: String): Double
|
||||
}
|
||||
}
|
||||
|
||||
object ObjWithNative {
|
||||
platformStatic native fun bar(l: Long, s: String): Double
|
||||
platformStatic external fun bar(l: Long, s: String): Double
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
|
||||
@@ -3,7 +3,7 @@ package foo
|
||||
import kotlin.jvm.*
|
||||
import kotlin.platform.*
|
||||
|
||||
native fun bar(l: Long, s: String): Double
|
||||
external fun bar(l: Long, s: String): Double
|
||||
|
||||
fun box(): String {
|
||||
var d = 0.0
|
||||
|
||||
Reference in New Issue
Block a user