Use default value if annotation vararg argument is empty

This commit is contained in:
Denis Zharkov
2015-04-06 15:51:11 +03:00
parent 9b1443954f
commit a29c0ff9a3
9 changed files with 112 additions and 0 deletions
@@ -0,0 +1,15 @@
// FILE: A.java
public @interface A {
String[] value() default {"abc", "cde"};
}
// FILE: b.kt
[A("1", "2", "3")] fun test1() {}
[A("4")] fun test2() {}
[A(*array("5", "6"), "7")] fun test3() {}
[A()] fun test4() {}
[A] fun test5() {}
@@ -0,0 +1,15 @@
package
A(value = {"1", "2", "3"}: kotlin.Array<out kotlin.String>) internal fun test1(): kotlin.Unit
A(value = {"4"}: kotlin.Array<out kotlin.String>) internal fun test2(): kotlin.Unit
A(value = {{"5", "6"}, "7"}: kotlin.Array<out kotlin.String>) internal fun test3(): kotlin.Unit
A() internal fun test4(): kotlin.Unit
A() internal fun test5(): kotlin.Unit
public final annotation class A : kotlin.Annotation {
public constructor A(/*0*/ vararg value: kotlin.String /*kotlin.Array<out kotlin.String>*/ = ...)
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
public abstract fun value(): kotlin.Array<kotlin.String>
}