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:
committed by
Alexander Udalov
parent
6f5ffeb6bb
commit
dd051c1556
+17
-17
@@ -1,7 +1,7 @@
|
||||
import java.lang.System;
|
||||
|
||||
@kotlin.Metadata()
|
||||
@java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
|
||||
@kotlin.Metadata()
|
||||
public abstract @interface Anno {
|
||||
}
|
||||
|
||||
@@ -12,8 +12,8 @@ import java.lang.System;
|
||||
|
||||
@kotlin.Metadata()
|
||||
public final class Bar {
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
@FieldAnno()
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
private final java.lang.String a = "";
|
||||
|
||||
public Bar() {
|
||||
@@ -25,8 +25,8 @@ public final class Bar {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Anno()
|
||||
@PropertyAnno()
|
||||
@Anno()
|
||||
@java.lang.Deprecated()
|
||||
public static void getA$annotations() {
|
||||
}
|
||||
@@ -39,9 +39,9 @@ import java.lang.System;
|
||||
|
||||
@kotlin.Metadata()
|
||||
public final class Baz {
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
@kotlin.jvm.JvmField()
|
||||
@FieldAnno()
|
||||
@kotlin.jvm.JvmField()
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
public final java.lang.String a = "";
|
||||
|
||||
public Baz() {
|
||||
@@ -59,10 +59,10 @@ public final class Baz {
|
||||
|
||||
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 FieldAnno {
|
||||
}
|
||||
|
||||
@@ -73,13 +73,13 @@ import java.lang.System;
|
||||
|
||||
@kotlin.Metadata()
|
||||
public final class Foo {
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
@FieldAnno()
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
private final java.lang.String a = null;
|
||||
|
||||
public Foo(@org.jetbrains.annotations.NotNull()
|
||||
public Foo(@ParameterAnno()
|
||||
@Anno()
|
||||
@ParameterAnno()
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
java.lang.String a) {
|
||||
super();
|
||||
}
|
||||
@@ -100,10 +100,10 @@ public final class Foo {
|
||||
|
||||
import java.lang.System;
|
||||
|
||||
@kotlin.Metadata()
|
||||
@java.lang.annotation.Target(value = {java.lang.annotation.ElementType.PARAMETER})
|
||||
@java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
|
||||
@kotlin.annotation.Target(allowedTargets = {kotlin.annotation.AnnotationTarget.VALUE_PARAMETER})
|
||||
@java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
|
||||
@java.lang.annotation.Target(value = {java.lang.annotation.ElementType.PARAMETER})
|
||||
@kotlin.Metadata()
|
||||
public abstract @interface ParameterAnno {
|
||||
}
|
||||
|
||||
@@ -112,9 +112,9 @@ public abstract @interface ParameterAnno {
|
||||
|
||||
import java.lang.System;
|
||||
|
||||
@kotlin.Metadata()
|
||||
@java.lang.annotation.Target(value = {})
|
||||
@java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
|
||||
@kotlin.annotation.Target(allowedTargets = {kotlin.annotation.AnnotationTarget.PROPERTY})
|
||||
@java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
|
||||
@java.lang.annotation.Target(value = {})
|
||||
@kotlin.Metadata()
|
||||
public abstract @interface PropertyAnno {
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user