KT-62560 [SLC] Fix handling of empty varargs in annotations

This commit is contained in:
strangepleasures
2023-11-20 20:57:21 +00:00
committed by Space Team
parent 4f5926a88f
commit 03ed1d1d31
20 changed files with 794 additions and 9 deletions
@@ -0,0 +1,49 @@
@java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
public abstract @interface A /* A*/ {
public abstract int[] x();// x()
}
public final class AnnotationWithVaragArgumentsKt /* AnnotationWithVaragArgumentsKt*/ {
@A()
@B(x = "x", z = "z")
@C(a = @A(), b = @B(x = "x", z = "z"))
@D()
@E(d = @D())
public static final void foo();// foo()
@A(x = {1, 2})
@B(x = "x", y = {1, 2}, z = "z")
@C(a = @A(x = {1, 2}), b = @B(x = "x", y = {1, 2}, z = "z"))
public static final void baz();// baz()
@A(x = {1})
@B(x = "x", y = {1}, z = "z")
@C(a = @A(x = {1}), b = @B(x = "x", y = {1}, z = "z"))
public static final void bar();// bar()
}
@java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
public abstract @interface B /* B*/ {
public abstract int[] y();// y()
public abstract java.lang.String x();// x()
public abstract java.lang.String z();// z()
}
@java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
public abstract @interface C /* C*/ {
public abstract A a();// a()
public abstract B b();// b()
}
@java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
public abstract @interface D /* D*/ {
public abstract java.lang.String[] x() default {"a", "b"};// x()
}
@java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
public abstract @interface E /* E*/ {
public abstract D d();// d()
}
@@ -0,0 +1,49 @@
@java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
public abstract @interface A /* A*/ {
public abstract int[] x();// x()
}
public final class AnnotationWithVaragArgumentsKt /* AnnotationWithVaragArgumentsKt*/ {
@A(x = {1, 2})
@B(x = "x", y = {1, 2}, z = "z")
@C(a = @A(x = {1, 2}), b = @B(x = "x", y = {1, 2}, z = "z"))
public static final void baz();// baz()
@A(x = {1})
@B(x = "x", y = {1}, z = "z")
@C(a = @A(x = {1}), b = @B(x = "x", y = {1}, z = "z"))
public static final void bar();// bar()
@A(x = {})
@B(x = "x", z = "z", y = {})
@C(a = @A(x = {}), b = @B(x = "x", z = "z", y = {}))
@D()
@E(d = @D())
public static final void foo();// foo()
}
@java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
public abstract @interface B /* B*/ {
public abstract int[] y();// y()
public abstract java.lang.String x();// x()
public abstract java.lang.String z();// z()
}
@java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
public abstract @interface C /* C*/ {
public abstract A a();// a()
public abstract B b();// b()
}
@java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
public abstract @interface D /* D*/ {
public abstract java.lang.String[] x() default {"a", "b"};// x()
}
@java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
public abstract @interface E /* E*/ {
public abstract D d();// d()
}
@@ -0,0 +1,22 @@
annotation class A(vararg val x: Int)
annotation class B(val x: String, vararg val y: Int, val z: String)
annotation class C(val a: A, val b: B)
annotation class D(vararg val x: String = ["a", "b"])
annotation class E(val d: D)
@A
@B(x = "x", z = "z")
@C(A(), B("x", z = "z"))
@D()
@E(d = D())
fun foo() {}
@A(1)
@B("x", 1, z = "z")
@C(A(1), B("x", 1, z = "z"))
fun bar() {}
@A(1, 2)
@B("x", 1, 2, z = "z")
@C(A(1, 2), B("x", 1, 2, z = "z"))
fun baz() {}
@@ -0,0 +1,49 @@
@java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
public abstract @interface A /* A*/ {
public abstract int[] x();// x()
}
public final class AnnotationWithVaragArgumentsKt /* AnnotationWithVaragArgumentsKt*/ {
@A(x = {1, 2})
@B(x = "x", y = {1, 2}, z = "z")
@C(a = @A(x = {1, 2}), b = @B(x = "x", y = {1, 2}, z = "z"))
public static final void baz();// baz()
@A(x = {1})
@B(x = "x", y = {1}, z = "z")
@C(a = @A(x = {1}), b = @B(x = "x", y = {1}, z = "z"))
public static final void bar();// bar()
@A(x = {})
@B(x = "x", y = {}, z = "z")
@C(a = @A(x = {}), b = @B(x = "x", y = {}, z = "z"))
@D()
@E(d = @D())
public static final void foo();// foo()
}
@java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
public abstract @interface B /* B*/ {
public abstract int[] y();// y()
public abstract java.lang.String x();// x()
public abstract java.lang.String z();// z()
}
@java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
public abstract @interface C /* C*/ {
public abstract A a();// a()
public abstract B b();// b()
}
@java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
public abstract @interface D /* D*/ {
public abstract java.lang.String[] x() default {"a", "b"};// x()
}
@java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
public abstract @interface E /* E*/ {
public abstract D d();// d()
}