Get rid of deprecated annotations in testData
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
annotation class A(val a: Int = 0)
|
||||
|
||||
A fun test1() = 1
|
||||
A(2) fun test2() = 1
|
||||
@A fun test1() = 1
|
||||
@A(2) fun test2() = 1
|
||||
|
||||
fun box(): String {
|
||||
if ((test1() + test2()) == 2) {
|
||||
|
||||
+4
-4
@@ -1,7 +1,7 @@
|
||||
JavaAnn class MyClass1
|
||||
JavaAnn() class MyClass2
|
||||
JavaAnn("asd") class MyClass3
|
||||
JavaAnn(*array()) class MyClass4
|
||||
@JavaAnn class MyClass1
|
||||
@JavaAnn() class MyClass2
|
||||
@JavaAnn("asd") class MyClass3
|
||||
@JavaAnn(*array()) class MyClass4
|
||||
|
||||
|
||||
fun box(): String {
|
||||
|
||||
+4
-4
@@ -1,7 +1,7 @@
|
||||
JavaAnn class MyClass1
|
||||
JavaAnn() class MyClass2
|
||||
JavaAnn("asd") class MyClass3
|
||||
JavaAnn(*array()) class MyClass4
|
||||
@JavaAnn class MyClass1
|
||||
@JavaAnn() class MyClass2
|
||||
@JavaAnn("asd") class MyClass3
|
||||
@JavaAnn(*array()) class MyClass4
|
||||
|
||||
|
||||
fun box(): String {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
JavaAnn("value") class MyClass
|
||||
@JavaAnn("value") class MyClass
|
||||
|
||||
fun box(): String {
|
||||
val ann = javaClass<MyClass>().getAnnotation(javaClass<JavaAnn>())
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
JavaAnn class MyClass
|
||||
JavaAnn2 class MyClass2
|
||||
@JavaAnn class MyClass
|
||||
@JavaAnn2 class MyClass2
|
||||
|
||||
fun box(): String {
|
||||
val ann = javaClass<MyClass>().getAnnotation(javaClass<JavaAnn>())
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
Ann(Foo.i, Foo.s, Foo.f, Foo.d, Foo.l, Foo.b) class MyClass
|
||||
@Ann(Foo.i, Foo.s, Foo.f, Foo.d, Foo.l, Foo.b) class MyClass
|
||||
|
||||
fun box(): String {
|
||||
val ann = javaClass<MyClass>().getAnnotation(javaClass<Ann>())
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
Ann(Foo.i, Foo.s, Foo.f, Foo.d, Foo.l, Foo.b, Foo.bool, Foo.c, Foo.str, Foo.charAsInt, Foo.intAsChar) class MyClass
|
||||
@Ann(Foo.i, Foo.s, Foo.f, Foo.d, Foo.l, Foo.b, Foo.bool, Foo.c, Foo.str, Foo.charAsInt, Foo.intAsChar) class MyClass
|
||||
|
||||
fun box(): String {
|
||||
val ann = javaClass<MyClass>().getAnnotation(javaClass<Ann>())
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
Ann(Foo.i, Foo.s, Foo.f, Foo.d, Foo.l, Foo.b, Foo.c) class MyClass
|
||||
@Ann(Foo.i, Foo.s, Foo.f, Foo.d, Foo.l, Foo.b, Foo.c) class MyClass
|
||||
|
||||
fun box(): String {
|
||||
val ann = javaClass<MyClass>().getAnnotation(javaClass<Ann>())
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
class O
|
||||
class K
|
||||
|
||||
JavaAnn(args = array(O::class, K::class)) class MyClass
|
||||
@JavaAnn(args = array(O::class, K::class)) class MyClass
|
||||
|
||||
fun box(): String {
|
||||
val args = javaClass<MyClass>().getAnnotation(javaClass<JavaAnn>()).args()
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
|
||||
class OK
|
||||
|
||||
JavaAnn(OK::class) class MyClass
|
||||
@JavaAnn(OK::class) class MyClass
|
||||
|
||||
fun box(): String {
|
||||
val ann = javaClass<MyClass>().getAnnotation(javaClass<JavaAnn>())
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
class O
|
||||
class K
|
||||
|
||||
JavaAnn(O::class, K::class) class MyClass
|
||||
@JavaAnn(O::class, K::class) class MyClass
|
||||
|
||||
fun box(): String {
|
||||
val args = javaClass<MyClass>().getAnnotation(javaClass<JavaAnn>()).value
|
||||
|
||||
+4
-4
@@ -1,7 +1,7 @@
|
||||
JavaAnn class MyClass1
|
||||
JavaAnn() class MyClass2
|
||||
JavaAnn("asd") class MyClass3
|
||||
JavaAnn(*array()) class MyClass4
|
||||
@JavaAnn class MyClass1
|
||||
@JavaAnn() class MyClass2
|
||||
@JavaAnn("asd") class MyClass3
|
||||
@JavaAnn(*array()) class MyClass4
|
||||
|
||||
|
||||
fun box(): String {
|
||||
|
||||
+4
-4
@@ -1,7 +1,7 @@
|
||||
JavaAnn class MyClass1
|
||||
JavaAnn() class MyClass2
|
||||
JavaAnn("asd") class MyClass3
|
||||
JavaAnn(*array()) class MyClass4
|
||||
@JavaAnn class MyClass1
|
||||
@JavaAnn() class MyClass2
|
||||
@JavaAnn("asd") class MyClass3
|
||||
@JavaAnn(*array()) class MyClass4
|
||||
|
||||
|
||||
fun box(): String {
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
JavaAnn("value") class MyClass
|
||||
@JavaAnn("value") class MyClass
|
||||
|
||||
fun box(): String {
|
||||
val ann = javaClass<MyClass>().getAnnotation(javaClass<JavaAnn>())
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
JavaAnn class MyClass
|
||||
JavaAnn2 class MyClass2
|
||||
@JavaAnn class MyClass
|
||||
@JavaAnn2 class MyClass2
|
||||
|
||||
fun box(): String {
|
||||
val ann = javaClass<MyClass>().getAnnotation(javaClass<JavaAnn>())
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
class O
|
||||
class K
|
||||
|
||||
JavaAnn(args = array(O::class, K::class)) class MyClass
|
||||
@JavaAnn(args = array(O::class, K::class)) class MyClass
|
||||
|
||||
fun box(): String {
|
||||
val args = javaClass<MyClass>().getAnnotation(javaClass<JavaAnn>()).args()
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
|
||||
class OK
|
||||
|
||||
JavaAnn(OK::class) class MyClass
|
||||
@JavaAnn(OK::class) class MyClass
|
||||
|
||||
fun box(): String {
|
||||
val ann = javaClass<MyClass>().getAnnotation(javaClass<JavaAnn>())
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
class O
|
||||
class K
|
||||
|
||||
JavaAnn(O::class, K::class) class MyClass
|
||||
@JavaAnn(O::class, K::class) class MyClass
|
||||
|
||||
fun box(): String {
|
||||
val args = javaClass<MyClass>().getAnnotation(javaClass<JavaAnn>()).value()
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import java.lang.annotation.*
|
||||
|
||||
Foo class Bar
|
||||
@Foo class Bar
|
||||
|
||||
fun box(): String {
|
||||
Bar()
|
||||
|
||||
+2
-2
@@ -8,14 +8,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 {
|
||||
|
||||
+4
-4
@@ -5,13 +5,13 @@ 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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -5,9 +5,9 @@ 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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+4
-4
@@ -4,13 +4,13 @@ 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 {
|
||||
|
||||
+2
-2
@@ -3,9 +3,9 @@ import kotlin.test.assertEquals
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
annotation class Ann(val x: Int)
|
||||
class A {
|
||||
Ann(1) fun foo(x: Int, y: Int = 2, z: Int) {}
|
||||
@Ann(1) fun foo(x: Int, y: Int = 2, z: Int) {}
|
||||
|
||||
Ann(1) constructor(x: Int, y: Int = 2, z: Int)
|
||||
@Ann(1) constructor(x: Int, y: Int = 2, z: Int)
|
||||
}
|
||||
|
||||
class B @Ann(1) constructor(x: Int, y: Int = 2, z: Int) {}
|
||||
|
||||
+1
-1
@@ -33,4 +33,4 @@ enum class MyEnum {
|
||||
|
||||
class A
|
||||
|
||||
Ann class MyClass
|
||||
@Ann class MyClass
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
Ann(Foo.i, Foo.s, Foo.f, Foo.d, Foo.l, Foo.b, Foo.bool, Foo.c, Foo.str) class MyClass
|
||||
@Ann(Foo.i, Foo.s, Foo.f, Foo.d, Foo.l, Foo.b, Foo.bool, Foo.c, Foo.str) class MyClass
|
||||
|
||||
fun box(): String {
|
||||
val ann = javaClass<MyClass>().getAnnotation(javaClass<Ann>())
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
Ann(i, s, f, d, l, b, bool, c, str) class MyClass
|
||||
@Ann(i, s, f, d, l, b, bool, c, str) class MyClass
|
||||
|
||||
fun box(): String {
|
||||
val ann = javaClass<MyClass>().getAnnotation(javaClass<Ann>())
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
Ann(A.B.i) class MyClass
|
||||
@Ann(A.B.i) class MyClass
|
||||
|
||||
fun box(): String {
|
||||
val ann = javaClass<MyClass>().getAnnotation(javaClass<Ann>())
|
||||
|
||||
+1
-1
@@ -24,4 +24,4 @@ fun box(): String {
|
||||
return "OK"
|
||||
}
|
||||
|
||||
Ann(1, 1, 1, 1.0.toFloat(), 1.0, 1, 'c', true) class MyClass
|
||||
@Ann(1, 1, 1, 1.0.toFloat(), 1.0, 1, 'c', true) class MyClass
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
Ann(i) class MyClass
|
||||
@Ann(i) class MyClass
|
||||
|
||||
fun box(): String {
|
||||
val ann = javaClass<MyClass>().getAnnotation(javaClass<Ann>())
|
||||
|
||||
+10
-10
@@ -1,19 +1,19 @@
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
annotation class Ann(vararg val p: Int)
|
||||
|
||||
Ann() class MyClass1
|
||||
Ann(1) class MyClass2
|
||||
Ann(1, 2) class MyClass3
|
||||
@Ann() class MyClass1
|
||||
@Ann(1) class MyClass2
|
||||
@Ann(1, 2) class MyClass3
|
||||
|
||||
Ann(*intArray()) class MyClass4
|
||||
Ann(*intArray(1)) class MyClass5
|
||||
Ann(*intArray(1, 2)) class MyClass6
|
||||
@Ann(*intArray()) class MyClass4
|
||||
@Ann(*intArray(1)) class MyClass5
|
||||
@Ann(*intArray(1, 2)) class MyClass6
|
||||
|
||||
Ann(p = 1) class MyClass7
|
||||
@Ann(p = 1) class MyClass7
|
||||
|
||||
Ann(p = *intArray()) class MyClass8
|
||||
Ann(p = *intArray(1)) class MyClass9
|
||||
Ann(p = *intArray(1, 2)) class MyClass10
|
||||
@Ann(p = *intArray()) class MyClass8
|
||||
@Ann(p = *intArray(1)) class MyClass9
|
||||
@Ann(p = *intArray(1, 2)) class MyClass10
|
||||
|
||||
fun box(): String {
|
||||
test(javaClass<MyClass1>(), "")
|
||||
|
||||
@@ -3,7 +3,7 @@ package test
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
annotation class Ann(val c1: Int)
|
||||
|
||||
Ann('a' - 'a') class MyClass
|
||||
@Ann('a' - 'a') class MyClass
|
||||
|
||||
fun box(): String {
|
||||
val annotation = javaClass<MyClass>().getAnnotation(javaClass<Ann>())!!
|
||||
|
||||
@@ -6,7 +6,7 @@ annotation class Ann(
|
||||
val l: Long
|
||||
)
|
||||
|
||||
Ann(1 / 1, 1 / 1, 1 / 1, 1 / 1) class MyClass
|
||||
@Ann(1 / 1, 1 / 1, 1 / 1, 1 / 1) class MyClass
|
||||
|
||||
fun box(): String {
|
||||
val annotation = javaClass<MyClass>().getAnnotation(javaClass<Ann>())!!
|
||||
|
||||
@@ -7,7 +7,7 @@ annotation class Ann(
|
||||
val p5: Int
|
||||
)
|
||||
|
||||
Ann(1 plus 1, 1 minus 1, 1 times 1, 1 div 1, 1 mod 1) class MyClass
|
||||
@Ann(1 plus 1, 1 minus 1, 1 times 1, 1 div 1, 1 mod 1) class MyClass
|
||||
|
||||
fun box(): String {
|
||||
val annotation = javaClass<MyClass>().getAnnotation(javaClass<Ann>())!!
|
||||
|
||||
@@ -15,7 +15,7 @@ val prop4: Int = 1 shl 1
|
||||
val prop5: Int = 1 shr 1
|
||||
val prop6: Int = 1 ushr 1
|
||||
|
||||
Ann(1 or 1, 1 and 1, 1 xor 1, 1 shl 1, 1 shr 1, 1 ushr 1) class MyClass
|
||||
@Ann(1 or 1, 1 and 1, 1 xor 1, 1 shl 1, 1 shr 1, 1 ushr 1) class MyClass
|
||||
|
||||
fun box(): String {
|
||||
val annotation = javaClass<MyClass>().getAnnotation(javaClass<Ann>())!!
|
||||
|
||||
@@ -8,7 +8,7 @@ annotation class Ann(
|
||||
val p6: Long
|
||||
)
|
||||
|
||||
Ann(
|
||||
@Ann(
|
||||
p1 = java.lang.Byte.MAX_VALUE + 1,
|
||||
p2 = java.lang.Short.MAX_VALUE + 1,
|
||||
p3 = java.lang.Integer.MAX_VALUE + 1,
|
||||
|
||||
@@ -6,7 +6,7 @@ annotation class Ann(
|
||||
val p5: Int
|
||||
)
|
||||
|
||||
Ann(
|
||||
@Ann(
|
||||
p1 = java.lang.Byte.MAX_VALUE + 1,
|
||||
p2 = 1 + 1,
|
||||
p4 = 1 + 1,
|
||||
|
||||
@@ -6,7 +6,7 @@ annotation class Ann(
|
||||
val p5: Int
|
||||
)
|
||||
|
||||
Ann(
|
||||
@Ann(
|
||||
p1 = java.lang.Integer.MAX_VALUE + 1,
|
||||
p2 = 1 + 1,
|
||||
p4 = 1 + 1,
|
||||
|
||||
@@ -15,7 +15,7 @@ val prop4: Long = 1 * 1
|
||||
val prop5: Double = 1.0 * 1.0
|
||||
val prop6: Float = 1.0.toFloat() * 1.0.toFloat()
|
||||
|
||||
Ann(1 * 1, 1 * 1, 1 * 1, 1 * 1, 1.0 * 1.0, 1.0.toFloat() * 1.0.toFloat()) class MyClass
|
||||
@Ann(1 * 1, 1 * 1, 1 * 1, 1 * 1, 1.0 * 1.0, 1.0.toFloat() * 1.0.toFloat()) class MyClass
|
||||
|
||||
fun box(): String {
|
||||
val annotation = javaClass<MyClass>().getAnnotation(javaClass<Ann>())!!
|
||||
|
||||
@@ -15,7 +15,7 @@ val prop4: Long = 1 - 1
|
||||
val prop5: Double = 1.0 - 1.0
|
||||
val prop6: Float = 1.0.toFloat() - 1.0.toFloat()
|
||||
|
||||
Ann(1 - 1, 1 - 1, 1 - 1, 1 - 1, 1.0 - 1.0, 1.0.toFloat() - 1.0.toFloat()) class MyClass
|
||||
@Ann(1 - 1, 1 - 1, 1 - 1, 1 - 1, 1.0 - 1.0, 1.0.toFloat() - 1.0.toFloat()) class MyClass
|
||||
|
||||
fun box(): String {
|
||||
val annotation = javaClass<MyClass>().getAnnotation(javaClass<Ann>())!!
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@ val prop4: Long = 1 % 1
|
||||
val prop5: Double = 1.0 % 1.0
|
||||
val prop6: Float = 1.0.toFloat() % 1.0.toFloat()
|
||||
|
||||
Ann(1 % 1, 1 % 1, 1 % 1, 1 % 1, 1.0 % 1.0, 1.0.toFloat() % 1.0.toFloat()) class MyClass
|
||||
@Ann(1 % 1, 1 % 1, 1 % 1, 1 % 1, 1.0 % 1.0, 1.0.toFloat() % 1.0.toFloat()) class MyClass
|
||||
|
||||
fun box(): String {
|
||||
val annotation = javaClass<MyClass>().getAnnotation(javaClass<Ann>())!!
|
||||
|
||||
@@ -15,7 +15,7 @@ val prop4: Long = (1 + 2) * 2
|
||||
val prop5: Double = (1.0 + 2) * 2
|
||||
val prop6: Float = (1.toFloat() + 2) * 2
|
||||
|
||||
Ann((1 + 2) * 2, (1 + 2) * 2, (1 + 2) * 2, (1 + 2) * 2, (1.0 + 2) * 2, (1.toFloat() + 2) * 2) class MyClass
|
||||
@Ann((1 + 2) * 2, (1 + 2) * 2, (1 + 2) * 2, (1 + 2) * 2, (1.0 + 2) * 2, (1.toFloat() + 2) * 2) class MyClass
|
||||
|
||||
fun box(): String {
|
||||
val annotation = javaClass<MyClass>().getAnnotation(javaClass<Ann>())!!
|
||||
|
||||
@@ -15,7 +15,7 @@ val prop4: Long = 1 + 1
|
||||
val prop5: Double = 1.0 + 1.0
|
||||
val prop6: Float = 1.0.toFloat() + 1.0.toFloat()
|
||||
|
||||
Ann(1 + 1, 1 + 1, 1 + 1, 1 + 1, 1.0 + 1.0, 1.0.toFloat() + 1.0.toFloat()) class MyClass
|
||||
@Ann(1 + 1, 1 + 1, 1 + 1, 1 + 1, 1.0 + 1.0, 1.0.toFloat() + 1.0.toFloat()) class MyClass
|
||||
|
||||
fun box(): String {
|
||||
val annotation = javaClass<MyClass>().getAnnotation(javaClass<Ann>())!!
|
||||
|
||||
@@ -13,7 +13,7 @@ val prop3: Int = 1.times(1)
|
||||
val prop4: Int = 1.div(1)
|
||||
val prop5: Int = 1.mod(1)
|
||||
|
||||
Ann(prop1, prop2, prop3, prop4, prop5) class MyClass
|
||||
@Ann(prop1, prop2, prop3, prop4, prop5) class MyClass
|
||||
|
||||
fun box(): String {
|
||||
val annotation = javaClass<MyClass>().getAnnotation(javaClass<Ann>())!!
|
||||
|
||||
@@ -15,7 +15,7 @@ val prop4: Long = -1
|
||||
val prop5: Double = -1.0
|
||||
val prop6: Float = -1.0.toFloat()
|
||||
|
||||
Ann(prop1, prop2, prop3, prop4, prop5, prop6) class MyClass
|
||||
@Ann(prop1, prop2, prop3, prop4, prop5, prop6) class MyClass
|
||||
|
||||
fun box(): String {
|
||||
val annotation = javaClass<MyClass>().getAnnotation(javaClass<Ann>())!!
|
||||
|
||||
@@ -15,7 +15,7 @@ val prop4: Long = +1
|
||||
val prop5: Double = +1.0
|
||||
val prop6: Float = +1.0.toFloat()
|
||||
|
||||
Ann(prop1, prop2, prop3, prop4, prop5, prop6) class MyClass
|
||||
@Ann(prop1, prop2, prop3, prop4, prop5, prop6) class MyClass
|
||||
|
||||
fun box(): String {
|
||||
val annotation = javaClass<MyClass>().getAnnotation(javaClass<Ann>())!!
|
||||
|
||||
@@ -6,7 +6,7 @@ import kotlin.platform.*
|
||||
object ObjWithNative {
|
||||
external fun foo(x: Int = 1): Double
|
||||
|
||||
platformStatic external fun bar(l: Long, s: String = ""): Double
|
||||
@platformStatic external fun bar(l: Long, s: String = ""): Double
|
||||
}
|
||||
|
||||
external fun topLevel(x: Int = 1): Double
|
||||
|
||||
@@ -3,7 +3,7 @@ import kotlin.platform.*
|
||||
|
||||
class C {
|
||||
companion object {
|
||||
private platformStatic external fun foo()
|
||||
private @platformStatic external fun foo()
|
||||
}
|
||||
|
||||
fun bar() {
|
||||
|
||||
@@ -5,12 +5,12 @@ import kotlin.platform.*
|
||||
|
||||
class WithNative {
|
||||
companion object {
|
||||
platformStatic external fun bar(l: Long, s: String): Double
|
||||
@platformStatic external fun bar(l: Long, s: String): Double
|
||||
}
|
||||
}
|
||||
|
||||
object ObjWithNative {
|
||||
platformStatic external fun bar(l: Long, s: String): Double
|
||||
@platformStatic external fun bar(l: Long, s: String): Double
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
|
||||
@@ -4,13 +4,13 @@ object A {
|
||||
|
||||
val b: String = "OK"
|
||||
|
||||
platformStatic var c: String = "Fail"
|
||||
@platformStatic var c: String = "Fail"
|
||||
|
||||
platformStatic fun test1() : String {
|
||||
@platformStatic fun test1() : String {
|
||||
return b
|
||||
}
|
||||
|
||||
platformStatic fun test2() : String {
|
||||
@platformStatic fun test2() : String {
|
||||
return test1()
|
||||
}
|
||||
|
||||
@@ -18,11 +18,11 @@ object A {
|
||||
return "1".test5()
|
||||
}
|
||||
|
||||
platformStatic fun test4(): String {
|
||||
@platformStatic fun test4(): String {
|
||||
return "1".test5()
|
||||
}
|
||||
|
||||
platformStatic fun String.test5() : String {
|
||||
@platformStatic fun String.test5() : String {
|
||||
return this + b
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,13 +4,13 @@ object A {
|
||||
|
||||
val b: String = "OK"
|
||||
|
||||
platformStatic val c: String = "OK"
|
||||
@platformStatic val c: String = "OK"
|
||||
|
||||
platformStatic fun test1() : String {
|
||||
@platformStatic fun test1() : String {
|
||||
return {b}()
|
||||
}
|
||||
|
||||
platformStatic fun test2() : String {
|
||||
@platformStatic fun test2() : String {
|
||||
return {test1()}()
|
||||
}
|
||||
|
||||
@@ -18,11 +18,11 @@ object A {
|
||||
return {"1".test5()}()
|
||||
}
|
||||
|
||||
platformStatic fun test4(): String {
|
||||
@platformStatic fun test4(): String {
|
||||
return {"1".test5()}()
|
||||
}
|
||||
|
||||
platformStatic fun String.test5() : String {
|
||||
@platformStatic fun String.test5() : String {
|
||||
return {this + b}()
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ object A {
|
||||
v += B(1000)
|
||||
}
|
||||
|
||||
platformStatic fun B.plusAssign(b: B) {
|
||||
@platformStatic fun B.plusAssign(b: B) {
|
||||
this.s += b.s
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ import kotlin.platform.platformStatic
|
||||
|
||||
object A {
|
||||
|
||||
platformStatic fun test(b: String = "OK") : String {
|
||||
@platformStatic fun test(b: String = "OK") : String {
|
||||
return b
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,9 +2,9 @@ import kotlin.platform.platformStatic
|
||||
|
||||
object AX {
|
||||
|
||||
platformStatic val c: String = "OK"
|
||||
@platformStatic val c: String = "OK"
|
||||
|
||||
platformStatic fun aStatic(): String {
|
||||
@platformStatic fun aStatic(): String {
|
||||
return AX.b()
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ object AX {
|
||||
return AX.b()
|
||||
}
|
||||
|
||||
platformStatic fun b(): String {
|
||||
@platformStatic fun b(): String {
|
||||
return "OK"
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ fun getA(): A {
|
||||
}
|
||||
|
||||
object A {
|
||||
platformStatic fun a(): String {
|
||||
@platformStatic fun a(): String {
|
||||
return holder
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ import kotlin.platform.platformStatic
|
||||
|
||||
object A {
|
||||
|
||||
platformStatic inline fun test(b: String = "OK") : String {
|
||||
@platformStatic inline fun test(b: String = "OK") : String {
|
||||
return b
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ import kotlin.platform.platformStatic
|
||||
|
||||
object A {
|
||||
|
||||
platformStatic var a: Int = 1
|
||||
@platformStatic var a: Int = 1
|
||||
|
||||
var b: Int = 1
|
||||
@platformStatic get
|
||||
|
||||
@@ -2,7 +2,7 @@ import kotlin.platform.platformStatic
|
||||
|
||||
object A {
|
||||
|
||||
platformStatic var a: Int = 1
|
||||
@platformStatic var a: Int = 1
|
||||
|
||||
var b: Int = 1
|
||||
@platformStatic get
|
||||
|
||||
@@ -2,7 +2,7 @@ import kotlin.platform.platformStatic
|
||||
|
||||
object A {
|
||||
|
||||
private platformStatic fun a(): String {
|
||||
private @platformStatic fun a(): String {
|
||||
return "OK"
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ fun getA(): A {
|
||||
|
||||
object A {
|
||||
|
||||
platformStatic var a: Int = 1
|
||||
@platformStatic var a: Int = 1
|
||||
|
||||
var b: Int = 1
|
||||
@platformStatic get
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
import kotlin.platform.platformStatic
|
||||
|
||||
object X {
|
||||
platformStatic val x = "OK"
|
||||
@platformStatic val x = "OK"
|
||||
|
||||
fun fn(value : String = x): String = value
|
||||
}
|
||||
|
||||
@@ -4,13 +4,13 @@ object A {
|
||||
|
||||
val b: String = "OK"
|
||||
|
||||
platformStatic val c: String = "OK"
|
||||
@platformStatic val c: String = "OK"
|
||||
|
||||
platformStatic fun test1() : String {
|
||||
@platformStatic fun test1() : String {
|
||||
return b
|
||||
}
|
||||
|
||||
platformStatic fun test2() : String {
|
||||
@platformStatic fun test2() : String {
|
||||
return test1()
|
||||
}
|
||||
|
||||
@@ -18,11 +18,11 @@ object A {
|
||||
return "1".test5()
|
||||
}
|
||||
|
||||
platformStatic fun test4(): String {
|
||||
@platformStatic fun test4(): String {
|
||||
return "1".test5()
|
||||
}
|
||||
|
||||
platformStatic fun String.test5() : String {
|
||||
@platformStatic fun String.test5() : String {
|
||||
return this + b
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@ import kotlin.platform.*
|
||||
|
||||
class C {
|
||||
companion object {
|
||||
private platformStatic fun foo(): String {
|
||||
private @platformStatic fun foo(): String {
|
||||
return "OK"
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+2
-2
@@ -1,13 +1,13 @@
|
||||
import kotlin.reflect.*
|
||||
import kotlin.reflect.jvm.*
|
||||
import kotlin.platform.platformStatic as static
|
||||
import kotlin.jvm.JvmStatic as static
|
||||
|
||||
class A {
|
||||
private var foo: String = ""
|
||||
}
|
||||
|
||||
object O {
|
||||
private static var bar: String = ""
|
||||
private @static var bar: String = ""
|
||||
}
|
||||
|
||||
class CounterTest<T>(t: T) {
|
||||
|
||||
+3
-3
@@ -1,4 +1,4 @@
|
||||
import kotlin.platform.platformStatic as static
|
||||
import kotlin.jvm.JvmStatic as static
|
||||
import kotlin.reflect.jvm.isAccessible
|
||||
import kotlin.reflect.KCallable
|
||||
|
||||
@@ -9,9 +9,9 @@ class A(private var bar: String = "") {
|
||||
}
|
||||
|
||||
object O {
|
||||
private static var baz: String = ""
|
||||
private @static var baz: String = ""
|
||||
|
||||
static fun getBaz() = O::baz.apply { isAccessible = true }
|
||||
@static fun getBaz() = O::baz.apply { isAccessible = true }
|
||||
}
|
||||
|
||||
fun check(callable: KCallable<*>, vararg args: Any?) {
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import kotlin.platform.platformStatic as static
|
||||
import kotlin.jvm.JvmStatic as static
|
||||
|
||||
object Obj {
|
||||
static fun foo() {}
|
||||
@static fun foo() {}
|
||||
}
|
||||
|
||||
class C {
|
||||
companion object {
|
||||
static fun bar() {}
|
||||
@static fun bar() {}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Vendored
+4
-4
@@ -1,9 +1,9 @@
|
||||
import kotlin.platform.platformStatic as static
|
||||
import kotlin.jvm.JvmStatic as static
|
||||
|
||||
object Obj {
|
||||
static fun foo(s: String) {}
|
||||
static fun bar() {}
|
||||
static fun sly(obj: Obj) {}
|
||||
@static fun foo(s: String) {}
|
||||
@static fun bar() {}
|
||||
@static fun sly(obj: Obj) {}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
|
||||
@@ -7,7 +7,7 @@ class A {
|
||||
}
|
||||
|
||||
object O {
|
||||
kotlin.platform.platformStatic fun baz() {}
|
||||
@kotlin.platform.platformStatic fun baz() {}
|
||||
}
|
||||
|
||||
fun nullableUnit(unit: Boolean): Unit? = if (unit) Unit else null
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
import kotlin.platform.platformStatic as static
|
||||
import kotlin.jvm.JvmStatic as static
|
||||
import kotlin.test.assertEquals
|
||||
|
||||
object Obj {
|
||||
static fun foo(a: String, b: String = "b") = a + b
|
||||
@static fun foo(a: String, b: String = "b") = a + b
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ annotation class Ann(val args: Array<KClass<*>>)
|
||||
class O
|
||||
class K
|
||||
|
||||
Ann(array(O::class, K::class)) class MyClass
|
||||
@Ann(array(O::class, K::class)) class MyClass
|
||||
|
||||
fun box(): String {
|
||||
val args = javaClass<MyClass>().getAnnotation(javaClass<Ann>()).args
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ annotation class Ann(val arg: KClass<*>)
|
||||
|
||||
class OK
|
||||
|
||||
Ann(OK::class) class MyClass
|
||||
@Ann(OK::class) class MyClass
|
||||
|
||||
fun box(): String {
|
||||
val argName = javaClass<MyClass>().getAnnotation(javaClass<Ann>()).arg.simpleName ?: "fail 1"
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ annotation class Ann(vararg val args: KClass<*>)
|
||||
class O
|
||||
class K
|
||||
|
||||
Ann(O::class, K::class) class MyClass
|
||||
@Ann(O::class, K::class) class MyClass
|
||||
|
||||
fun box(): String {
|
||||
val args = javaClass<MyClass>().getAnnotation(javaClass<Ann>()).args
|
||||
|
||||
compiler/testData/codegen/boxWithStdlib/reflection/mapping/platformStatic/companionObjectFunction.kt
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
import kotlin.platform.platformStatic as static
|
||||
import kotlin.jvm.JvmStatic as static
|
||||
import kotlin.reflect.jvm.*
|
||||
import kotlin.test.assertEquals
|
||||
import kotlin.test.failsWith
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
import kotlin.platform.platformStatic as static
|
||||
import kotlin.jvm.JvmStatic as static
|
||||
import kotlin.reflect.jvm.*
|
||||
import kotlin.test.assertEquals
|
||||
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
import kotlin.platform.platformStatic as static
|
||||
import kotlin.jvm.JvmStatic as static
|
||||
import kotlin.reflect.jvm.javaType
|
||||
import kotlin.test.assertEquals
|
||||
|
||||
@@ -7,7 +7,7 @@ class A {
|
||||
}
|
||||
|
||||
object O {
|
||||
static fun bar(a: A): String = ""
|
||||
@static fun bar(a: A): String = ""
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
// FULL_JDK
|
||||
|
||||
import java.lang.reflect.ParameterizedType
|
||||
import kotlin.platform.platformStatic as static
|
||||
import kotlin.jvm.JvmStatic as static
|
||||
import kotlin.reflect.*
|
||||
import kotlin.reflect.jvm.javaType
|
||||
import kotlin.test.assertEquals
|
||||
@@ -9,7 +9,7 @@ import kotlin.test.assertEquals
|
||||
class A(private var foo: List<String>)
|
||||
|
||||
object O {
|
||||
private static var bar: List<String> = listOf()
|
||||
private @static var bar: List<String> = listOf()
|
||||
}
|
||||
|
||||
fun topLevel(): List<String> = listOf()
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
import kotlin.platform.platformStatic as static
|
||||
import kotlin.jvm.JvmStatic as static
|
||||
import kotlin.reflect.KMutableProperty
|
||||
import kotlin.reflect.jvm.javaType
|
||||
import kotlin.test.assertEquals
|
||||
@@ -6,7 +6,7 @@ import kotlin.test.assertEquals
|
||||
class A(private var foo: String)
|
||||
|
||||
object O {
|
||||
private static var bar: String = ""
|
||||
private @static var bar: String = ""
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
|
||||
Vendored
+2
-2
@@ -1,9 +1,9 @@
|
||||
import kotlin.reflect.*
|
||||
import kotlin.reflect.jvm.*
|
||||
import kotlin.platform.platformStatic as static
|
||||
import kotlin.jvm.JvmStatic as static
|
||||
|
||||
object Obj {
|
||||
private static var result: String = "Fail"
|
||||
private @static var result: String = "Fail"
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
|
||||
@@ -4,7 +4,7 @@ import java.lang.annotation.Annotation
|
||||
annotation class foo(val name : String)
|
||||
|
||||
class Test() {
|
||||
foo("OK") fun hello(input : String) {
|
||||
@foo("OK") fun hello(input : String) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import kotlin.InlineOption.*
|
||||
|
||||
inline fun<reified T> createArray(n: Int, inlineOptions(ONLY_LOCAL_RETURN) block: () -> T): Array<T> {
|
||||
inline fun<reified T> createArray(n: Int, crossinline block: () -> T): Array<T> {
|
||||
return Array<T>(n) { block() }
|
||||
}
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import kotlin.InlineOption.*
|
||||
|
||||
inline fun<reified T> createArray(n: Int, inlineOptions(ONLY_LOCAL_RETURN) block: () -> T): Array<T> {
|
||||
inline fun<reified T> createArray(n: Int, crossinline block: () -> T): Array<T> {
|
||||
return Array<T>(n) { block() }
|
||||
}
|
||||
|
||||
inline fun<T1, T2, T3, T4, T5, T6, reified R> recursive(
|
||||
inlineOptions(ONLY_LOCAL_RETURN) block: () -> R
|
||||
crossinline block: () -> R
|
||||
): Array<R> {
|
||||
return createArray(5) { block() }
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import kotlin.InlineOption.*
|
||||
|
||||
inline fun<reified T1, reified T2> createArray(n: Int, inlineOptions(ONLY_LOCAL_RETURN) block: () -> Pair<T1, T2>): Pair<Array<T1>, Array<T2>> {
|
||||
inline fun<reified T1, reified T2> createArray(n: Int, crossinline block: () -> Pair<T1, T2>): Pair<Array<T1>, Array<T2>> {
|
||||
return Pair(Array(n) { block().first }, Array(n) { block().second })
|
||||
}
|
||||
|
||||
inline fun<T1, T2, T3, T4, T5, T6, reified R> recursive(
|
||||
inlineOptions(ONLY_LOCAL_RETURN) block: () -> R
|
||||
crossinline block: () -> R
|
||||
): Pair<Array<R>, Array<R>> {
|
||||
return createArray(5) { Pair(block(), block()) }
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
annotation class Ann(val arg: String = "abc")
|
||||
|
||||
Ann class MyClass
|
||||
@Ann class MyClass
|
||||
|
||||
// 1 @LAnn;\(\)
|
||||
|
||||
+2
-2
@@ -1,9 +1,9 @@
|
||||
import java.lang.annotation.Retention
|
||||
import java.lang.annotation.RetentionPolicy
|
||||
|
||||
Ann class MyClass
|
||||
@Ann class MyClass
|
||||
|
||||
Retention(RetentionPolicy.RUNTIME)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
annotation class Ann
|
||||
|
||||
// 1 @LAnn;()
|
||||
@@ -1,4 +1,4 @@
|
||||
Ann class MyClass
|
||||
@Ann class MyClass
|
||||
|
||||
@Retention(AnnotationRetention.BINARY)
|
||||
annotation class Ann
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Ann class MyClass
|
||||
@Ann class MyClass
|
||||
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
annotation class Ann
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Ann class MyClass
|
||||
@Ann class MyClass
|
||||
|
||||
@Retention(AnnotationRetention.SOURCE)
|
||||
annotation class Ann
|
||||
|
||||
@@ -5,7 +5,7 @@ class A {
|
||||
inlineFun { "test" }
|
||||
}
|
||||
|
||||
inline fun inlineFun(inlineOptions(ONLY_LOCAL_RETURN) lambda: () -> Unit) {
|
||||
inline fun inlineFun(crossinline lambda: () -> Unit) {
|
||||
val s = object {
|
||||
fun run() {
|
||||
lambda()
|
||||
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
import org.junit.Test
|
||||
|
||||
Test fun foo(m : java.lang.reflect.Method) = "OK"
|
||||
@Test fun foo(m : java.lang.reflect.Method) = "OK"
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@ import kotlin.test.*
|
||||
import org.junit.Test as test
|
||||
|
||||
public class Test {
|
||||
test fun f(): Unit {
|
||||
@test fun f(): Unit {
|
||||
assertEquals(true, !false)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user