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
+13 -13
View File
@@ -2,8 +2,8 @@ package test.another;
import java.lang.System;
@kotlin.Metadata()
@java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
@kotlin.Metadata()
public abstract @interface Anno {
public abstract java.lang.String value();
@@ -43,12 +43,12 @@ public final class TopLevelKt {
return null;
}
public static final void extensionFunction(@org.jetbrains.annotations.NotNull()
@Anno(value = "rec")
java.lang.String $this$extensionFunction, @org.jetbrains.annotations.NotNull()
@Anno(value = "1")
java.lang.String a, @org.jetbrains.annotations.NotNull()
@Anno(value = "2")
public static final void extensionFunction(@Anno(value = "rec")
@org.jetbrains.annotations.NotNull()
java.lang.String $this$extensionFunction, @Anno(value = "1")
@org.jetbrains.annotations.NotNull()
java.lang.String a, @Anno(value = "2")
@org.jetbrains.annotations.NotNull()
java.lang.String b) {
}
@@ -58,16 +58,16 @@ public final class TopLevelKt {
}
@org.jetbrains.annotations.NotNull()
public static final <T extends java.lang.Object>java.lang.String getExtensionProperty(@org.jetbrains.annotations.NotNull()
@Anno(value = "propRec")
public static final <T extends java.lang.Object>java.lang.String getExtensionProperty(@Anno(value = "propRec")
@org.jetbrains.annotations.NotNull()
T $this$extensionProperty) {
return null;
}
public static final <T extends java.lang.Object>void setExtensionProperty(@org.jetbrains.annotations.NotNull()
@Anno(value = "propRec")
T $this$extensionProperty, @org.jetbrains.annotations.NotNull()
@Anno(value = "setparam")
public static final <T extends java.lang.Object>void setExtensionProperty(@Anno(value = "propRec")
@org.jetbrains.annotations.NotNull()
T $this$extensionProperty, @Anno(value = "setparam")
@org.jetbrains.annotations.NotNull()
java.lang.String setParamName) {
}
}