Stable order of generated annotation targets

A random order of usages is enabled in 193 platform that makes tests flaky without the commit.
This commit is contained in:
Nikolay Krasko
2019-11-26 16:45:22 +03:00
parent 592df477e9
commit eb71e686da
2 changed files with 2 additions and 2 deletions

View File

@@ -93,7 +93,7 @@ private fun KtAnnotationEntry.getRequiredAnnotationTargets(annotationClass: KtCl
}.flatten().toSet()
val annotationTargetValueNames = AnnotationTarget.values().map { it.name }
return (requiredTargets + otherReferenceRequiredTargets).asSequence().distinct().filter { it.name in annotationTargetValueNames }
.toList()
.toList().sorted()
}
private fun getActualTargetList(annotated: PsiTarget): AnnotationChecker.Companion.TargetList {

View File

@@ -1,6 +1,6 @@
// "Add annotation target" "true"
@Target(AnnotationTarget.TYPE, AnnotationTarget.CLASS, AnnotationTarget.FUNCTION)
@Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION, AnnotationTarget.TYPE)
annotation class Foo
@Foo