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
@@ -95,13 +95,13 @@ public final class Experiment {
super();
}
@kotlin.Metadata()
@java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
@kotlin.Metadata()
public static abstract @interface Type {
}
@kotlin.Metadata()
@test.Experiment.Type()
@kotlin.Metadata()
public static final class Group {
@org.jetbrains.annotations.NotNull()
private final java.lang.String s = null;
@@ -123,8 +123,8 @@ public final class Experiment {
return 0;
}
@org.jetbrains.annotations.NotNull()
@java.lang.Override()
@org.jetbrains.annotations.NotNull()
public java.lang.String toString() {
return null;
}
@@ -190,15 +190,15 @@ public abstract interface IFoo {
@kotlin.Metadata()
public static abstract interface IBar {
@kotlin.Metadata()
@java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
@kotlin.Metadata()
public static abstract @interface Anno {
public abstract java.lang.Class<?>[] value();
}
@kotlin.Metadata()
@test.IFoo.IBar.Anno(value = {test.IFoo.IBar.IZoo.class})
@kotlin.Metadata()
public static abstract interface IZoo {
}
}
@@ -288,8 +288,8 @@ package test;
import java.lang.System;
@kotlin.Metadata()
@test.IFoo.IBar.Anno(value = {test.IFoo.IBar.IZoo.class, test.Foo.Bar.class})
@kotlin.Metadata()
public final class Test1 extends test.Foo.Bar implements test.IFoo.IBar, test.IFoo.IBar.IZoo {
@org.jetbrains.annotations.NotNull()
private final test.Foo.Bar.Zoo zoo = null;