Refine loading annotation parameters from java
- Parameter named `value` is always first - Array parameter represented as vararg iff its name is `value` and all other parameters have default values #KT-2576 Fixed #KT-6641 Fixed #KT-6220 Fixed #KT-6652 Fixed
This commit is contained in:
+9
@@ -0,0 +1,9 @@
|
||||
// FILE: A.java
|
||||
public @interface A {
|
||||
double b();
|
||||
Class<?> x1();
|
||||
int a();
|
||||
String value();
|
||||
Class<?> x();
|
||||
Class<?> x2();
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package
|
||||
|
||||
public final annotation class A : kotlin.Annotation {
|
||||
public constructor A(/*0*/ value: kotlin.String, /*1*/ b: kotlin.Double, /*2*/ x1: java.lang.Class<*>, /*3*/ a: kotlin.Int, /*4*/ x: java.lang.Class<*>, /*5*/ x2: java.lang.Class<*>)
|
||||
public abstract fun a(): kotlin.Int
|
||||
public abstract fun b(): kotlin.Double
|
||||
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.String
|
||||
public abstract fun x(): java.lang.Class<*>
|
||||
public abstract fun x1(): java.lang.Class<*>
|
||||
public abstract fun x2(): java.lang.Class<*>
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
// FILE: A.java
|
||||
public @interface A {
|
||||
double b();
|
||||
Class<?> x1();
|
||||
int a();
|
||||
Class<?> x();
|
||||
Class<?> x2();
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
package
|
||||
|
||||
public final annotation class A : kotlin.Annotation {
|
||||
public constructor A(/*0*/ b: kotlin.Double, /*1*/ x1: java.lang.Class<*>, /*2*/ a: kotlin.Int, /*3*/ x: java.lang.Class<*>, /*4*/ x2: java.lang.Class<*>)
|
||||
public abstract fun a(): kotlin.Int
|
||||
public abstract fun b(): kotlin.Double
|
||||
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 x(): java.lang.Class<*>
|
||||
public abstract fun x1(): java.lang.Class<*>
|
||||
public abstract fun x2(): java.lang.Class<*>
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
// FILE: A.java
|
||||
public @interface A {
|
||||
String[] value();
|
||||
Class<?> x() default Integer.class;
|
||||
int y();
|
||||
}
|
||||
|
||||
// FILE: b.kt
|
||||
[A("1", "2", "3", y = 1)] fun test1() {}
|
||||
|
||||
[A("4", y = 2)] fun test2() {}
|
||||
|
||||
[A(*array("5", "6"), "7", y = 3)] fun test3() {}
|
||||
|
||||
[A("1", "2", "3", x = javaClass<String>(), y = 4)] fun test4() {}
|
||||
|
||||
[A("4", y = 5)] fun test5() {}
|
||||
|
||||
[A(*array("5", "6"), "7", x = javaClass<Any>(), y = 6)] fun test6() {}
|
||||
|
||||
[A(y = 7)] fun test7() {}
|
||||
|
||||
[A("8", "9", "10"<!NO_VALUE_FOR_PARAMETER!>)<!>] fun test8() {}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
package
|
||||
|
||||
A(value = {"1", "2", "3"}: kotlin.Array<out kotlin.String>, y = IntegerValueType(1): IntegerValueType(1)) internal fun test1(): kotlin.Unit
|
||||
A(value = {"4"}: kotlin.Array<out kotlin.String>, y = IntegerValueType(2): IntegerValueType(2)) internal fun test2(): kotlin.Unit
|
||||
A(value = {{"5", "6"}, "7"}: kotlin.Array<out kotlin.String>, y = IntegerValueType(3): IntegerValueType(3)) internal fun test3(): kotlin.Unit
|
||||
A(value = {"1", "2", "3"}: kotlin.Array<out kotlin.String>, x = kotlin.String.class: java.lang.Class<kotlin.String>, y = IntegerValueType(4): IntegerValueType(4)) internal fun test4(): kotlin.Unit
|
||||
A(value = {"4"}: kotlin.Array<out kotlin.String>, y = IntegerValueType(5): IntegerValueType(5)) internal fun test5(): kotlin.Unit
|
||||
A(value = {{"5", "6"}, "7"}: kotlin.Array<out kotlin.String>, x = kotlin.Any.class: java.lang.Class<kotlin.Any>, y = IntegerValueType(6): IntegerValueType(6)) internal fun test6(): kotlin.Unit
|
||||
A(value = {}: kotlin.Array<out kotlin.String>, y = IntegerValueType(7): IntegerValueType(7)) internal fun test7(): kotlin.Unit
|
||||
A(value = {"8", "9", "10"}: kotlin.Array<out kotlin.String>) internal fun test8(): kotlin.Unit
|
||||
|
||||
public final annotation class A : kotlin.Annotation {
|
||||
public constructor A(/*0*/ vararg value: kotlin.String /*kotlin.Array<out kotlin.String>*/, /*1*/ x: java.lang.Class<*> = ..., /*2*/ y: kotlin.Int)
|
||||
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>
|
||||
public abstract fun x(): java.lang.Class<*>
|
||||
public abstract fun y(): kotlin.Int
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
// FILE: A.java
|
||||
public @interface A {
|
||||
String[] value();
|
||||
Class<?> x() default Integer.class;
|
||||
int y() default 1;
|
||||
}
|
||||
|
||||
// FILE: b.kt
|
||||
[A("1", "2", "3")] fun test1() {}
|
||||
|
||||
[A("4")] fun test2() {}
|
||||
|
||||
[A(*array("5", "6"), "7")] fun test3() {}
|
||||
|
||||
[A("1", "2", "3", x = javaClass<String>())] fun test4() {}
|
||||
|
||||
[A("4", y = 2)] fun test5() {}
|
||||
|
||||
[A(*array("5", "6"), "7", x = javaClass<Any>(), y = 3)] fun test6() {}
|
||||
|
||||
[A()] fun test7() {}
|
||||
|
||||
[A] fun test8() {}
|
||||
|
||||
[A(x = javaClass<Any>(), <!MIXING_NAMED_AND_POSITIONED_ARGUMENTS!>*array("5", "6")<!>, <!MIXING_NAMED_AND_POSITIONED_ARGUMENTS!>"7"<!>, y = 3)] fun test9() {}
|
||||
[A(x = javaClass<Any>(), value = *array("5", "6"), <!MIXING_NAMED_AND_POSITIONED_ARGUMENTS!>"7"<!>, y = 3)] fun test10() {}
|
||||
[A(x = javaClass<Any>(), value = *array("5", "6", "7"), y = 3)] fun test11() {}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
package
|
||||
|
||||
A(value = {"1", "2", "3"}: kotlin.Array<out kotlin.String>) internal fun test1(): kotlin.Unit
|
||||
A(value = {"5", "6"}: kotlin.Array<kotlin.String>, x = kotlin.Any.class: java.lang.Class<kotlin.Any>, y = IntegerValueType(3): IntegerValueType(3)) internal fun test10(): kotlin.Unit
|
||||
A(value = {"5", "6", "7"}: kotlin.Array<kotlin.String>, x = kotlin.Any.class: java.lang.Class<kotlin.Any>, y = IntegerValueType(3): IntegerValueType(3)) internal fun test11(): 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(value = {"1", "2", "3"}: kotlin.Array<out kotlin.String>, x = kotlin.String.class: java.lang.Class<kotlin.String>) internal fun test4(): kotlin.Unit
|
||||
A(value = {"4"}: kotlin.Array<out kotlin.String>, y = IntegerValueType(2): IntegerValueType(2)) internal fun test5(): kotlin.Unit
|
||||
A(value = {{"5", "6"}, "7"}: kotlin.Array<out kotlin.String>, x = kotlin.Any.class: java.lang.Class<kotlin.Any>, y = IntegerValueType(3): IntegerValueType(3)) internal fun test6(): kotlin.Unit
|
||||
A(value = {}: kotlin.Array<out kotlin.String>) internal fun test7(): kotlin.Unit
|
||||
A(value = {}: kotlin.Array<out kotlin.String>) internal fun test8(): kotlin.Unit
|
||||
A(value = {}: kotlin.Array<out kotlin.String>, x = kotlin.Any.class: java.lang.Class<kotlin.Any>, y = IntegerValueType(3): IntegerValueType(3)) internal fun test9(): kotlin.Unit
|
||||
|
||||
public final annotation class A : kotlin.Annotation {
|
||||
public constructor A(/*0*/ vararg value: kotlin.String /*kotlin.Array<out kotlin.String>*/, /*1*/ x: java.lang.Class<*> = ..., /*2*/ y: kotlin.Int = ...)
|
||||
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>
|
||||
public abstract fun x(): java.lang.Class<*>
|
||||
public abstract fun y(): kotlin.Int
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
// FILE: A.java
|
||||
public @interface A {
|
||||
String[] value();
|
||||
}
|
||||
|
||||
// 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() {}
|
||||
+15
@@ -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(value = {}: kotlin.Array<out kotlin.String>) internal fun test4(): kotlin.Unit
|
||||
A(value = {}: kotlin.Array<out kotlin.String>) 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>
|
||||
}
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
// FILE: A.java
|
||||
public @interface A {
|
||||
String[] arg();
|
||||
String[] value();
|
||||
}
|
||||
|
||||
// FILE: b.kt
|
||||
|
||||
+3
-3
@@ -1,11 +1,11 @@
|
||||
package
|
||||
|
||||
A(arg = {IntegerValueType(1), "b"}: kotlin.Array<???>) internal fun test(): kotlin.Unit
|
||||
A(value = {IntegerValueType(1), "b"}: kotlin.Array<???>) internal fun test(): kotlin.Unit
|
||||
|
||||
public final annotation class A : kotlin.Annotation {
|
||||
public constructor A(/*0*/ vararg arg: kotlin.String /*kotlin.Array<out kotlin.String>*/)
|
||||
public abstract fun arg(): kotlin.Array<kotlin.String>
|
||||
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>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user