Place array literals in annotations feature under the version 1.2

This commit is contained in:
Mikhail Zarechenskiy
2017-03-23 12:31:01 +03:00
parent 20d5616d75
commit 54f034a636
5 changed files with 7 additions and 13 deletions
@@ -1,3 +1,4 @@
// LANGUAGE_VERSION: 1.2
// WITH_REFLECT
// IGNORE_BACKEND: JS
@@ -15,18 +16,14 @@ fun check(b: Boolean, message: String) {
if (!b) throw RuntimeException(message)
}
@Suppress("UNSUPPORTED_FEATURE")
annotation class Foo(val a: FloatArray = [], val b: Array<String> = [], val c: Array<KClass<*>> = [])
@Suppress("UNSUPPORTED_FEATURE")
@Foo(a = [1f, 2f, 1 / 0f])
fun test1() {}
@Suppress("UNSUPPORTED_FEATURE")
@Foo(b = ["Hello", ", ", "Kot" + "lin"])
fun test2() {}
@Suppress("UNSUPPORTED_FEATURE")
@Foo(c = [Int::class, Array<Short>::class, Foo::class])
fun test3() {}
@@ -1,3 +1,4 @@
// LANGUAGE_VERSION: 1.2
// WITH_REFLECT
// IGNORE_BACKEND: JS
@@ -14,7 +15,6 @@ fun check(b: Boolean, message: String) {
if (!b) throw RuntimeException(message)
}
@Suppress("UNSUPPORTED_FEATURE")
annotation class Foo(val a: IntArray = [], val b: Array<String> = [])
const val ONE_INT = 1
@@ -22,7 +22,6 @@ const val ONE_FLOAT = 1f
const val HELLO = "hello"
const val C_CHAR = 'c'
@Suppress("UNSUPPORTED_FEATURE")
@Foo(
a = [ONE_INT, ONE_INT + ONE_FLOAT.toInt(), ONE_INT + 10, (ONE_INT % 1.0).toInt()],
b = [HELLO, HELLO + C_CHAR, HELLO + ", Kotlin", C_CHAR.toString() + C_CHAR])
@@ -1,3 +1,4 @@
// LANGUAGE_VERSION: 1.2
// WITH_REFLECT
// IGNORE_BACKEND: JS
@@ -15,17 +16,13 @@ fun check(b: Boolean, message: String) {
if (!b) throw RuntimeException(message)
}
@Suppress("UNSUPPORTED_FEATURE")
annotation class Foo(vararg val a: String = ["a", "b"])
@Suppress("UNSUPPORTED_FEATURE")
annotation class Bar(vararg val a: KClass<*> = [Int::class])
@Suppress("UNSUPPORTED_FEATURE")
@Foo(*["/"])
fun test1() {}
@Suppress("UNSUPPORTED_FEATURE")
@Bar(*[Long::class, String::class])
fun test2() {}
@@ -1,3 +1,4 @@
// LANGUAGE_VERSION: 1.2
// WITH_REFLECT
// IGNORE_BACKEND: JS
@@ -15,7 +16,6 @@ fun check(b: Boolean, message: String) {
if (!b) throw RuntimeException(message)
}
@Suppress("UNSUPPORTED_FEATURE")
annotation class Foo(
val a: IntArray = [],
val b: IntArray = [1, 2, 3],