JVM IR: minor, sort ElementType fields as in the old backend

In the old backend, targets are generated in the order of their
declaration in the ElementType enum, see AnnotationCodegen.java:306
(EnumSet guarantees such iteration ordering).

This has no effect other than reducing non-essential differences when
comparing ABI of JVM vs JVM_IR.
This commit is contained in:
Alexander Udalov
2020-10-09 17:17:34 +02:00
parent 1daeebcdd3
commit e399b4cd12
2 changed files with 7 additions and 7 deletions
@@ -11,12 +11,9 @@ public annotation class TestAnn
fun box(): String {
val testAnnClass = TestAnn::class.java
val targetAnn = testAnnClass.getAnnotation(java.lang.annotation.Target::class.java)
val targets = targetAnn.value
if (targets.size != 2) {
return targets.toList().toString()
}
if (targets.toSet() != setOf(java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.METHOD)) {
return targets.toList().toString()
val targets = targetAnn.value.toList()
if (targets != listOf(java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.METHOD)) {
return targets.toString()
}
return "OK"
}