drop deprecated @platformName and @platformStatic annotations

This commit is contained in:
Dmitry Jemerov
2015-10-29 14:29:53 +01:00
parent 15370244dc
commit 736b496f6a
74 changed files with 139 additions and 274 deletions
@@ -1,10 +1,9 @@
import kotlin.platform.platformName
import kotlin.reflect.jvm.*
var state: String = "value"
@platformName("getter")
@JvmName("getter")
get
@platformName("setter")
@JvmName("setter")
set
fun box(): String {
@@ -1,12 +1,11 @@
package foo
import kotlin.jvm.*
import kotlin.platform.*
object ObjWithNative {
external fun foo(x: Int = 1): Double
@platformStatic external fun bar(l: Long, s: String = ""): Double
@JvmStatic external fun bar(l: Long, s: String = ""): Double
}
external fun topLevel(x: Int = 1): Double
@@ -1,9 +1,8 @@
import kotlin.jvm.*
import kotlin.platform.*
class C {
companion object {
private @platformStatic external fun foo()
private @JvmStatic external fun foo()
}
fun bar() {
@@ -1,16 +1,15 @@
package foo
import kotlin.jvm.*
import kotlin.platform.*
class WithNative {
companion object {
@platformStatic external fun bar(l: Long, s: String): Double
@JvmStatic external fun bar(l: Long, s: String): Double
}
}
object ObjWithNative {
@platformStatic external fun bar(l: Long, s: String): Double
@JvmStatic external fun bar(l: Long, s: String): Double
}
fun box(): String {
@@ -1,7 +1,6 @@
package foo
import kotlin.jvm.*
import kotlin.platform.*
external fun bar(l: Long, s: String): Double
@@ -1,6 +1,4 @@
import kotlin.platform.*
@platformName("bar")
@JvmName("bar")
fun foo() = "foo"
fun box(): String {
@@ -1,8 +1,6 @@
import kotlin.platform.*
fun <T> List<T>.foo() = "foo"
@platformName("fooInt")
@JvmName("fooInt")
fun List<Int>.foo() = "fooInt"
fun box(): String {
@@ -1,5 +1,3 @@
import kotlin.platform.*
// See:
// http://kotlinlang.org/docs/reference/java-interop.html#handling-signature-clashes-with-platformname
// https://youtrack.jetbrains.com/issue/KT-5524
@@ -10,18 +8,18 @@ val ints = listOf(1, 2, 3)
class C {
// Instance methods
@platformName("instMethodStr")
@JvmName("instMethodStr")
fun instMethod(list: List<String>): String = "instMethodStr"
@platformName("instMethodInt")
@JvmName("instMethodInt")
fun instMethod(list: List<Int>): String = "instMethodInt"
// Properties
var rwProperty: Int
@platformName("get_rwProperty")
@JvmName("get_rwProperty")
get() = 123
@platformName("set_rwProperty")
@JvmName("set_rwProperty")
set(v) {}
var rwValue = 111
@@ -36,27 +34,27 @@ class C {
class Inner
@platformName("extMethodWithGenericParamStr")
@JvmName("extMethodWithGenericParamStr")
fun Inner.extMethodWithGenericParam(list: List<String>): String = "extMethodWithGenericParamStr"
@platformName("extMethodWithGenericParamInt")
@JvmName("extMethodWithGenericParamInt")
fun Inner.extMethodWithGenericParam(list: List<Int>): String = "extMethodWithGenericParamInt"
// This is already covered by extMethodWithGenericParam(), but might be relevant for a platform
// with extension method code generation strategy different from Java 6.
@platformName("extMethodWithGenericReceiverStr")
@JvmName("extMethodWithGenericReceiverStr")
fun List<String>.extMethodWithGenericReceiver(): String = "extMethodWithGenericReceiverStr"
@platformName("extMethodWithGenericReceiverInt")
@JvmName("extMethodWithGenericReceiverInt")
fun List<Int>.extMethodWithGenericReceiver(): String = "extMethodWithGenericReceiverInt"
// Extension method vs instance method
@platformName("ambigMethod1")
@JvmName("ambigMethod1")
fun ambigMethod(str: String): String = "ambigMethod1"
@platformName("ambigMethod2")
@JvmName("ambigMethod2")
fun String.ambigMethod(): String = "ambigMethod2"
}
@@ -1,6 +1,4 @@
import kotlin.platform.*
@platformName("bar")
@JvmName("bar")
fun foo() = "foo"
fun box(): String {
@@ -1,9 +1,7 @@
import kotlin.platform.*
var v: Int = 1
@platformName("vget")
@JvmName("vget")
get
@platformName("vset")
@JvmName("vset")
set
fun box(): String {
@@ -1,6 +1,6 @@
class C {
companion object {
@kotlin.platform.platformStatic @kotlin.jvm.JvmOverloads public fun foo(o: String, k: String = "K"): String {
@JvmStatic @kotlin.jvm.JvmOverloads public fun foo(o: String, k: String = "K"): String {
return o + k
}
}
@@ -1,16 +1,14 @@
import kotlin.platform.platformStatic
object A {
val b: String = "OK"
@platformStatic val c: String = "OK"
@JvmStatic val c: String = "OK"
@platformStatic fun test1() : String {
@JvmStatic fun test1() : String {
return {b}()
}
@platformStatic fun test2() : String {
@JvmStatic fun test2() : String {
return {test1()}()
}
@@ -18,11 +16,11 @@ object A {
return {"1".test5()}()
}
@platformStatic fun test4(): String {
@JvmStatic fun test4(): String {
return {"1".test5()}()
}
@platformStatic fun String.test5() : String {
@JvmStatic fun String.test5() : String {
return {this + b}()
}
@@ -1,5 +1,3 @@
import kotlin.platform.platformStatic
class B(var s: Int = 0) {
}
@@ -10,7 +8,7 @@ object A {
v += B(1000)
}
@platformStatic fun B.plusAssign(b: B) {
@JvmStatic fun B.plusAssign(b: B) {
this.s += b.s
}
}
@@ -1,8 +1,6 @@
import kotlin.platform.platformStatic
object A {
@platformStatic fun test(b: String = "OK") : String {
@JvmStatic fun test(b: String = "OK") : String {
return b
}
}
@@ -1,10 +1,8 @@
import kotlin.platform.platformStatic
object AX {
@platformStatic val c: String = "OK"
@JvmStatic val c: String = "OK"
@platformStatic fun aStatic(): String {
@JvmStatic fun aStatic(): String {
return AX.b()
}
@@ -12,7 +10,7 @@ object AX {
return AX.b()
}
@platformStatic fun b(): String {
@JvmStatic fun b(): String {
return "OK"
}
@@ -1,5 +1,3 @@
import kotlin.platform.platformStatic
var holder = ""
fun getA(): A {
@@ -8,7 +6,7 @@ fun getA(): A {
}
object A {
@platformStatic fun a(): String {
@JvmStatic fun a(): String {
return holder
}
}
@@ -1,8 +1,6 @@
import kotlin.platform.platformStatic
object A {
@platformStatic inline fun test(b: String = "OK") : String {
@JvmStatic inline fun test(b: String = "OK") : String {
return b
}
}
@@ -1,14 +1,12 @@
import kotlin.platform.platformStatic
object A {
@platformStatic var a: Int = 1
@JvmStatic var a: Int = 1
var b: Int = 1
@platformStatic get
@JvmStatic get
var c: Int = 1
@platformStatic set
@JvmStatic set
}
@@ -1,14 +1,12 @@
import kotlin.platform.platformStatic
object A {
@platformStatic var a: Int = 1
@JvmStatic var a: Int = 1
var b: Int = 1
@platformStatic get
@JvmStatic get
var c: Int = 1
@platformStatic set
@JvmStatic set
}
@@ -1,8 +1,6 @@
import kotlin.platform.platformStatic
object A {
private @platformStatic fun a(): String {
private @JvmStatic fun a(): String {
return "OK"
}
@@ -1,5 +1,3 @@
import kotlin.platform.platformStatic
var holder = ""
fun getA(): A {
@@ -9,13 +7,13 @@ fun getA(): A {
object A {
@platformStatic var a: Int = 1
@JvmStatic var a: Int = 1
var b: Int = 1
@platformStatic get
@JvmStatic get
var c: Int = 1
@platformStatic set
@JvmStatic set
}
@@ -1,7 +1,5 @@
import kotlin.platform.platformStatic
object X {
@platformStatic val x = "OK"
@JvmStatic val x = "OK"
fun fn(value : String = x): String = value
}
@@ -1,16 +1,14 @@
import kotlin.platform.platformStatic
object A {
val b: String = "OK"
@platformStatic val c: String = "OK"
@JvmStatic val c: String = "OK"
@platformStatic fun test1() : String {
@JvmStatic fun test1() : String {
return b
}
@platformStatic fun test2() : String {
@JvmStatic fun test2() : String {
return test1()
}
@@ -18,11 +16,11 @@ object A {
return "1".test5()
}
@platformStatic fun test4(): String {
@JvmStatic fun test4(): String {
return "1".test5()
}
@platformStatic fun String.test5() : String {
@JvmStatic fun String.test5() : String {
return this + b
}
}
@@ -1,8 +1,6 @@
import kotlin.platform.*
class C {
companion object {
private @platformStatic fun foo(): String {
private @JvmStatic fun foo(): String {
return "OK"
}
}
@@ -7,7 +7,7 @@ class A {
}
object O {
@kotlin.platform.platformStatic fun baz() {}
@JvmStatic fun baz() {}
}
fun nullableUnit(unit: Boolean): Unit? = if (unit) Unit else null
@@ -1,13 +1,11 @@
package test
import kotlin.platform.platformStatic
open class B
class A {
companion object {
@platformStatic
@JvmStatic
fun <T: B> a(s: T) : T {
return s
}