Allow to use emptyArray in annotation as argument

#KT-14236 Fixed
This commit is contained in:
Mikhail Zarechenskiy
2017-02-06 20:17:03 +03:00
parent 9f0403f72c
commit d7093db5c5
10 changed files with 62 additions and 20 deletions
@@ -0,0 +1,8 @@
annotation class Anno(val x: Array<String> = emptyArray())
@Anno fun test1() = 1
@Anno(arrayOf("K")) fun test2() = 2
fun box(): String {
return if (test1() + test2() == 3) "OK" else "Fail"
}
@@ -0,0 +1,12 @@
@java.lang.annotation.Retention
@kotlin.Metadata
public annotation class Anno {
public abstract method x(): java.lang.String[]
}
@kotlin.Metadata
public final class AnnotationWithEmptyArrayKt {
public final static @org.jetbrains.annotations.NotNull method box(): java.lang.String
public final static @Anno method test1(): int
public final static @Anno method test2(): int
}
@@ -19,6 +19,7 @@ val i2 = foo()
fun foo(): Int = 1
@AnnSA(emptyArray())
class MyClass {
val i = 1
}
@@ -37,7 +37,7 @@ public final annotation class AnnSA : kotlin.Annotation {
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public final class MyClass {
@AnnSA(sa = {}) public final class MyClass {
public constructor MyClass()
public final val i: kotlin.Int = 1
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean