File tree Expand file tree Collapse file tree
test/kotlin/library-tests/annotation_classes Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -120,7 +120,12 @@ private newtype TPrintAstNode =
120120 shouldPrint ( lvde , _) and lvde .getParent ( ) instanceof SingleLocalVarDeclParent
121121 } or
122122 TAnnotationsNode ( Annotatable ann ) {
123- shouldPrint ( ann , _) and ann .hasDeclaredAnnotation ( ) and not partOfAnnotation ( ann )
123+ shouldPrint ( ann , _) and
124+ ann .hasDeclaredAnnotation ( ) and
125+ not partOfAnnotation ( ann ) and
126+ // The Kotlin compiler might add annotations that are only present in byte code, although the annotatable element is
127+ // present in source code.
128+ exists ( Annotation a | a .getAnnotatedElement ( ) = ann and shouldPrint ( a , _) )
124129 } or
125130 TParametersNode ( Callable c ) { shouldPrint ( c , _) and not c .hasNoParameters ( ) } or
126131 TBaseTypesNode ( ClassOrInterface ty ) { shouldPrint ( ty , _) } or
Original file line number Diff line number Diff line change @@ -11,15 +11,11 @@ def.kt:
1111# 14| 0: [MethodAccess] abc(...)
1212# 14| -1: [VarAccess] a
1313# 1| 2: [Interface] SomeAnnotation
14- #-----| -3: (Annotations)
1514# 1| 1: [Method] abc
16- #-----| 1: (Annotations)
1715# 1| 2: [Method] y
1816# 3| 3: [Interface] ReplaceWith
19- #-----| -3: (Annotations)
2017# 3| 1: [Method] expression
2118# 5| 4: [Interface] Deprecated
22- #-----| -3: (Annotations)
2319# 6| 1: [Method] message
2420# 7| 2: [Method] replaceWith
2521# 9| 5: [Class] X
You can’t perform that action at this time.
0 commit comments