KAPT: Preserve the order of annotations in the stubs

Previously the annotations were included in reverse order. With this
change they are kept in the same order as in the source file.

This changes the test case for KT-23427 but that issue seems to relate
to annotation arguments that are missing, not the order of repeatable
annotations.

This fixes KT-51087
This commit is contained in:
Nicklas Ansman Giertz
2022-09-16 16:32:31 -04:00
committed by Alexander Udalov
parent 6f5ffeb6bb
commit dd051c1556
72 changed files with 355 additions and 310 deletions
@@ -2,8 +2,8 @@ package app;
import java.lang.System;
@kotlin.Metadata()
@java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
@kotlin.Metadata()
public abstract @interface Anno {
public abstract boolean a1();
@@ -59,8 +59,8 @@ package app;
import java.lang.System;
@kotlin.Metadata()
@java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
@kotlin.Metadata()
public abstract @interface Bind {
public abstract int id();
@@ -72,10 +72,10 @@ package app;
import java.lang.System;
@kotlin.Metadata()
@java.lang.annotation.Target(value = {java.lang.annotation.ElementType.FIELD})
@java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
@kotlin.annotation.Target(allowedTargets = {kotlin.annotation.AnnotationTarget.FIELD})
@java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
@java.lang.annotation.Target(value = {java.lang.annotation.ElementType.FIELD})
@kotlin.Metadata()
public abstract @interface BindField {
public abstract int id();
@@ -115,8 +115,8 @@ package app;
import java.lang.System;
@kotlin.Metadata()
@java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
@kotlin.Metadata()
public abstract @interface MultiValue {
public abstract int[] ids();
@@ -128,8 +128,8 @@ package app;
import java.lang.System;
@kotlin.Metadata()
@java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
@kotlin.Metadata()
public abstract @interface MultiValueByte {
public abstract byte[] ids();
@@ -141,8 +141,8 @@ package app;
import java.lang.System;
@kotlin.Metadata()
@java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
@kotlin.Metadata()
public abstract @interface MultiValueString {
public abstract java.lang.String[] ids();
@@ -221,8 +221,8 @@ public final class MyActivity {
return 0;
}
@Anno(a1 = app.B.a1, a2 = app.B.a2, a3 = app.B.a3, a4 = app.B.a4, a5 = app.B.a5, a6 = app.B.a6, a7 = app.B.a7, a8 = app.B.a8, a9 = "A")
@Bind(id = app.R2.layout.mainActivity)
@Anno(a1 = app.B.a1, a2 = app.B.a2, a3 = app.B.a3, a4 = app.B.a4, a5 = app.B.a5, a6 = app.B.a6, a7 = app.B.a7, a8 = app.B.a8, a9 = "A")
@java.lang.Deprecated()
public static void getE$annotations() {
}
@@ -252,8 +252,8 @@ public final class MyActivity {
public final void foo4() {
}
@Anno(a1 = app.B.a1, a2 = app.B.a2, a3 = app.B.a3, a4 = app.B.a4, a5 = app.B.a5, a6 = app.B.a6, a7 = app.B.a7, a8 = app.B.a8, a9 = "A")
@Bind(id = app.R2.layout.mainActivity)
@Anno(a1 = app.B.a1, a2 = app.B.a2, a3 = app.B.a3, a4 = app.B.a4, a5 = app.B.a5, a6 = app.B.a6, a7 = app.B.a7, a8 = app.B.a8, a9 = "A")
public final void foo5() {
}