Get rid of deprecated annotations in testData

This commit is contained in:
Denis Zharkov
2015-09-14 17:40:41 +03:00
parent eebe66e041
commit bae3320d52
257 changed files with 433 additions and 463 deletions
@@ -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) {}
@@ -33,4 +33,4 @@ enum class MyEnum {
class A
Ann class MyClass
@Ann class MyClass
@@ -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,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,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>())
@@ -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
@@ -1,4 +1,4 @@
Ann(i) class MyClass
@Ann(i) class MyClass
fun box(): String {
val ann = javaClass<MyClass>().getAnnotation(javaClass<Ann>())
@@ -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>(), "")
+1 -1
View File
@@ -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>())!!
+1 -1
View File
@@ -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>())!!
+1 -1
View File
@@ -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
View File
@@ -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>())!!
+1 -1
View File
@@ -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,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
}
}
@@ -2,7 +2,7 @@ import kotlin.platform.*
class C {
companion object {
private platformStatic fun foo(): String {
private @platformStatic fun foo(): String {
return "OK"
}
}
@@ -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) {
@@ -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() {}
}
}
@@ -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
@@ -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 {
@@ -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
@@ -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"
@@ -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
@@ -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
@@ -1,4 +1,4 @@
import kotlin.platform.platformStatic as static
import kotlin.jvm.JvmStatic as static
import kotlin.reflect.jvm.*
import kotlin.test.assertEquals
@@ -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 {
@@ -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()
@@ -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 {
@@ -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()) }
}