Deprecate JVM platform annotations in favor of capitilized themselves
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
class C<T> {
|
||||
@kotlin.jvm.jvmOverloads public fun foo(o: T, k: String = "K"): String = o.toString() + k
|
||||
@kotlin.jvm.JvmOverloads public fun foo(o: T, k: String = "K"): String = o.toString() + k
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class C {
|
||||
@kotlin.jvm.jvmOverloads public fun foo(o: String = "O", k: String = "K"): String = o + k
|
||||
@kotlin.jvm.JvmOverloads public fun foo(o: String = "O", k: String = "K"): String = o + k
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import kotlin.jvm.jvmName;
|
||||
import kotlin.jvm.JvmName;
|
||||
|
||||
public class FakePlatformName {
|
||||
@jvmName(name = "fake")
|
||||
@JvmName(name = "fake")
|
||||
public String foo() {
|
||||
return "foo";
|
||||
}
|
||||
|
||||
+3
-3
@@ -1,4 +1,4 @@
|
||||
import kotlin.jvm.jvmStatic
|
||||
import kotlin.jvm.JvmStatic
|
||||
|
||||
annotation(retention = AnnotationRetention.RUNTIME) class testAnnotation
|
||||
|
||||
@@ -7,14 +7,14 @@ class A {
|
||||
companion object {
|
||||
val b: String = "OK"
|
||||
|
||||
jvmStatic testAnnotation fun test1() = b
|
||||
JvmStatic testAnnotation fun test1() = b
|
||||
}
|
||||
}
|
||||
|
||||
object B {
|
||||
val b: String = "OK"
|
||||
|
||||
jvmStatic testAnnotation fun test1() = b
|
||||
JvmStatic testAnnotation fun test1() = b
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
|
||||
+5
-5
@@ -1,17 +1,17 @@
|
||||
import kotlin.jvm.jvmStatic
|
||||
import kotlin.jvm.JvmStatic
|
||||
|
||||
class A {
|
||||
|
||||
companion object {
|
||||
val b: String = "OK"
|
||||
|
||||
jvmStatic val c: String = "OK"
|
||||
JvmStatic val c: String = "OK"
|
||||
|
||||
jvmStatic fun test1() = b
|
||||
JvmStatic fun test1() = b
|
||||
|
||||
jvmStatic fun test2() = b
|
||||
JvmStatic fun test2() = b
|
||||
|
||||
jvmStatic fun String.test3() = this + b
|
||||
JvmStatic fun String.test3() = this + b
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -1,13 +1,13 @@
|
||||
import kotlin.jvm.jvmStatic
|
||||
import kotlin.jvm.JvmStatic
|
||||
|
||||
enum class A {
|
||||
;
|
||||
companion object {
|
||||
val foo: String = "OK"
|
||||
|
||||
jvmStatic val bar: String = "OK"
|
||||
JvmStatic val bar: String = "OK"
|
||||
|
||||
jvmStatic fun baz() = foo
|
||||
JvmStatic fun baz() = foo
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+5
-5
@@ -1,16 +1,16 @@
|
||||
import kotlin.jvm.jvmStatic
|
||||
import kotlin.jvm.JvmStatic
|
||||
|
||||
object A {
|
||||
|
||||
val b: String = "OK"
|
||||
|
||||
jvmStatic val c: String = "OK"
|
||||
JvmStatic val c: String = "OK"
|
||||
|
||||
jvmStatic fun test1() = b
|
||||
JvmStatic fun test1() = b
|
||||
|
||||
jvmStatic fun test2() = b
|
||||
JvmStatic fun test2() = b
|
||||
|
||||
jvmStatic fun String.test3() = this + b
|
||||
JvmStatic fun String.test3() = this + b
|
||||
}
|
||||
|
||||
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 {
|
||||
@kotlin.platform.platformStatic @kotlin.jvm.JvmOverloads public fun foo(o: String, k: String = "K"): String {
|
||||
return o + k
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class C {
|
||||
@kotlin.jvm.jvmOverloads public fun foo(o: String = "O", i1: Int, k: String = "K", i2: Int): String {
|
||||
@kotlin.jvm.JvmOverloads public fun foo(o: String = "O", i1: Int, k: String = "K", i2: Int): String {
|
||||
return o + k
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class C {
|
||||
@kotlin.jvm.jvmOverloads public fun foo(d1: Double, d2: Double, status: String = "OK"): String {
|
||||
@kotlin.jvm.JvmOverloads public fun foo(d1: Double, d2: Double, status: String = "OK"): String {
|
||||
return if (d1 + d2 == 3.0) status else "fail"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
class C {
|
||||
}
|
||||
|
||||
@kotlin.jvm.jvmOverloads fun C.foo(o: String, k: String = "K"): String {
|
||||
@kotlin.jvm.JvmOverloads fun C.foo(o: String, k: String = "K"): String {
|
||||
return o + k
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
class C {
|
||||
@kotlin.jvm.jvmOverloads public fun foo(o: String = "O", k: String = "K"): String {
|
||||
@kotlin.jvm.JvmOverloads public fun foo(o: String = "O", k: String = "K"): String {
|
||||
return o + k
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
class C {
|
||||
@kotlin.jvm.jvmOverloads public fun foo(o: String, k: String = "K"): String {
|
||||
@kotlin.jvm.JvmOverloads public fun foo(o: String, k: String = "K"): String {
|
||||
return o + k
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class C @kotlin.jvm.jvmOverloads constructor(s1: String, s2: String = "K") {
|
||||
class C @kotlin.jvm.JvmOverloads constructor(s1: String, s2: String = "K") {
|
||||
public val status: String = s1 + s2
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
class C(val i: Int) {
|
||||
var status = "fail"
|
||||
|
||||
@kotlin.jvm.jvmOverloads constructor(o: String, k: String = "K"): this(-1) {
|
||||
@kotlin.jvm.JvmOverloads constructor(o: String, k: String = "K"): this(-1) {
|
||||
status = o + k
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class C {
|
||||
@kotlin.jvm.jvmOverloads public fun foo(s: String = "OK"): String {
|
||||
@kotlin.jvm.JvmOverloads public fun foo(s: String = "OK"): String {
|
||||
return s
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
@jvmName("Fail")
|
||||
@JvmName("Fail")
|
||||
fun OK() {}
|
||||
|
||||
fun box() = ::OK.name
|
||||
|
||||
compiler/testData/codegen/boxWithStdlib/reflection/mapping/platformStatic/companionObjectFunction.kt
Vendored
+1
-1
@@ -21,7 +21,7 @@ fun box(): String {
|
||||
|
||||
val staticMethod = javaClass<C>().getDeclaredMethod("foo", javaClass<String>())
|
||||
val k2 = staticMethod.kotlinFunction ?:
|
||||
return "Fail: no Kotlin function found for static bridge for @jvmStatic method in companion object C::foo"
|
||||
return "Fail: no Kotlin function found for static bridge for @JvmStatic method in companion object C::foo"
|
||||
assertEquals(3, k2.call(C, "ghi"))
|
||||
|
||||
failsWith(javaClass<NullPointerException>()) { k2.call(null, "")!! }
|
||||
|
||||
Reference in New Issue
Block a user