Accept annotation_classes test changes

This commit is contained in:
Chris Smowton
2022-11-11 14:02:15 +00:00
parent df90fc1a80
commit d530817afc
5 changed files with 141 additions and 32 deletions

View File

@@ -23,10 +23,18 @@ def.kt:
# 0| [CompilationUnit] def
# 0| 1: [Class] DefKt
# 46| 2: [Method] fn
#-----| 1: (Annotations)
# 45| 1: [Annotation] Annot0k
# 0| 1: [IntegerLiteral] 0
#-----| 2: (Generic Parameters)
# 46| 0: [TypeVariable] T
# 46| 3: [TypeAccess] Unit
#-----| 4: (Parameters)
# 46| 0: [Parameter] a
#-----| -1: (Annotations)
# 46| 1: [Annotation] Annot0k
# 0| 1: [IntegerLiteral] 0
# 46| 0: [TypeAccess] Annot0k
# 46| 5: [BlockStmt] { ... }
# 47| 0: [ExprStmt] <Expr>;
# 47| 0: [MethodAccess] println(...)
@@ -43,43 +51,102 @@ def.kt:
# 53| -1: [TypeAccess] int
# 57| 0: [IntegerLiteral] 5
# 57| 4: [Method] getP
#-----| 1: (Annotations)
# 54| 1: [Annotation] Annot0k
# 0| 1: [IntegerLiteral] 0
# 57| 3: [TypeAccess] int
# 57| 5: [BlockStmt] { ... }
# 57| 0: [ReturnStmt] return ...
# 57| 0: [VarAccess] p
# 57| 4: [Method] setP
# 57| 0: [VarAccess] DefKt.p
# 57| -1: [TypeAccess] DefKt
# 57| 5: [Method] setP
#-----| 1: (Annotations)
# 55| 1: [Annotation] Annot0k
# 0| 1: [IntegerLiteral] 0
# 57| 3: [TypeAccess] Unit
#-----| 4: (Parameters)
# 57| 0: [Parameter] <set-?>
# 57| 0: [TypeAccess] int
# 57| 5: [BlockStmt] { ... }
# 57| 0: [ExprStmt] <Expr>;
# 57| 0: [AssignExpr] ...=...
# 57| 0: [VarAccess] p
# 57| 0: [VarAccess] DefKt.p
# 57| -1: [TypeAccess] DefKt
# 57| 1: [VarAccess] <set-?>
# 59| 6: [ExtensionMethod] myExtension
# 59| 3: [TypeAccess] Unit
#-----| 4: (Parameters)
# 59| 0: [Parameter] <this>
#-----| -1: (Annotations)
# 59| 1: [Annotation] Annot0k
# 0| 1: [IntegerLiteral] 0
# 59| 0: [TypeAccess] String
# 59| 5: [BlockStmt] { ... }
# 5| 2: [Interface] Annot0k
#-----| -3: (Annotations)
# 5| 5: [Annotation] Target
# 0| 1: [Annotation] Retention
# 0| 1: [VarAccess] RetentionPolicy.RUNTIME
# 0| -1: [TypeAccess] RetentionPolicy
# 0| 2: [Annotation] Target
# 0| 1: [ArrayInit] {...}
# 0| 1: [VarAccess] CLASS
# 0| 1: [VarAccess] ANNOTATION_CLASS
# 0| 1: [VarAccess] TYPE_PARAMETER
# 0| 1: [VarAccess] PROPERTY
# 0| 1: [VarAccess] FIELD
# 0| 1: [VarAccess] LOCAL_VARIABLE
# 0| 1: [VarAccess] VALUE_PARAMETER
# 0| 1: [VarAccess] CONSTRUCTOR
# 0| 1: [VarAccess] FUNCTION
# 0| 1: [VarAccess] PROPERTY_GETTER
# 0| 1: [VarAccess] PROPERTY_SETTER
# 0| 1: [VarAccess] TYPE
# 0| 1: [VarAccess] FILE
# 0| 1: [VarAccess] TYPEALIAS
# 0| 1: [VarAccess] ElementType.TYPE
# 0| -1: [TypeAccess] ElementType
# 0| 1: [VarAccess] ElementType.FIELD
# 0| -1: [TypeAccess] ElementType
# 0| 1: [VarAccess] ElementType.METHOD
# 0| -1: [TypeAccess] ElementType
# 0| 1: [VarAccess] ElementType.PARAMETER
# 0| -1: [TypeAccess] ElementType
# 0| 1: [VarAccess] ElementType.CONSTRUCTOR
# 0| -1: [TypeAccess] ElementType
# 0| 1: [VarAccess] ElementType.LOCAL_VARIABLE
# 0| -1: [TypeAccess] ElementType
# 0| 1: [VarAccess] ElementType.ANNOTATION_TYPE
# 0| -1: [TypeAccess] ElementType
# 0| 1: [VarAccess] ElementType.TYPE_PARAMETER
# 0| -1: [TypeAccess] ElementType
# 0| 1: [VarAccess] ElementType.TYPE_USE
# 0| -1: [TypeAccess] ElementType
# 5| 3: [Annotation] Target
# 0| 1: [ArrayInit] {...}
# 0| 1: [VarAccess] AnnotationTarget.CLASS
# 0| -1: [TypeAccess] AnnotationTarget
# 0| 1: [VarAccess] AnnotationTarget.ANNOTATION_CLASS
# 0| -1: [TypeAccess] AnnotationTarget
# 0| 1: [VarAccess] AnnotationTarget.TYPE_PARAMETER
# 0| -1: [TypeAccess] AnnotationTarget
# 0| 1: [VarAccess] AnnotationTarget.PROPERTY
# 0| -1: [TypeAccess] AnnotationTarget
# 0| 1: [VarAccess] AnnotationTarget.FIELD
# 0| -1: [TypeAccess] AnnotationTarget
# 0| 1: [VarAccess] AnnotationTarget.LOCAL_VARIABLE
# 0| -1: [TypeAccess] AnnotationTarget
# 0| 1: [VarAccess] AnnotationTarget.VALUE_PARAMETER
# 0| -1: [TypeAccess] AnnotationTarget
# 0| 1: [VarAccess] AnnotationTarget.CONSTRUCTOR
# 0| -1: [TypeAccess] AnnotationTarget
# 0| 1: [VarAccess] AnnotationTarget.FUNCTION
# 0| -1: [TypeAccess] AnnotationTarget
# 0| 1: [VarAccess] AnnotationTarget.PROPERTY_GETTER
# 0| -1: [TypeAccess] AnnotationTarget
# 0| 1: [VarAccess] AnnotationTarget.PROPERTY_SETTER
# 0| -1: [TypeAccess] AnnotationTarget
# 0| 1: [VarAccess] AnnotationTarget.TYPE
# 0| -1: [TypeAccess] AnnotationTarget
# 0| 1: [VarAccess] AnnotationTarget.FILE
# 0| -1: [TypeAccess] AnnotationTarget
# 0| 1: [VarAccess] AnnotationTarget.TYPEALIAS
# 0| -1: [TypeAccess] AnnotationTarget
# 21| 1: [Method] a
#-----| 1: (Annotations)
# 21| 1: [Annotation] JvmName
# 0| 1: [StringLiteral] "a"
# 23| 3: [Interface] Annot1k
#-----| -3: (Annotations)
# 23| 4: [Annotation] Annot0k
# 0| 1: [Annotation] Retention
# 0| 1: [VarAccess] RetentionPolicy.RUNTIME
# 0| -1: [TypeAccess] RetentionPolicy
# 23| 2: [Annotation] Annot0k
# 0| 1: [IntegerLiteral] 0
# 25| 1: [Method] a
# 26| 2: [Method] b
@@ -93,33 +160,57 @@ def.kt:
# 33| 0: [SuperConstructorInvocationStmt] super(...)
# 33| 1: [BlockStmt] { ... }
# 34| 5: [Class] Y
# 0| 2: [Method] values
# 0| 2: [Method] valueOf
# 0| 3: [TypeAccess] Y
#-----| 4: (Parameters)
# 0| 0: [Parameter] value
# 0| 0: [TypeAccess] String
# 0| 3: [Method] values
# 0| 3: [TypeAccess] Y[]
# 0| 0: [TypeAccess] Y
# 34| 4: [Constructor] Y
# 34| 5: [BlockStmt] { ... }
# 34| 0: [ExprStmt] <Expr>;
# 34| 0: [ClassInstanceExpr] new Enum(...)
# 34| -3: [TypeAccess] Unit
# 34| -3: [TypeAccess] Enum<Y>
# 34| 0: [TypeAccess] Y
# 34| 0: [NullLiteral] null
# 34| 1: [IntegerLiteral] 0
# 34| 1: [BlockStmt] { ... }
# 35| 5: [FieldDeclaration] Y A;
# 35| -1: [TypeAccess] Y
# 35| 0: [ClassInstanceExpr] new Y(...)
# 35| -3: [TypeAccess] Y
# 35| 6: [FieldDeclaration] Y B;
# 35| -1: [TypeAccess] Y
# 35| 0: [ClassInstanceExpr] new Y(...)
# 35| -3: [TypeAccess] Y
# 35| 7: [FieldDeclaration] Y C;
# 35| -1: [TypeAccess] Y
# 35| 0: [ClassInstanceExpr] new Y(...)
# 35| -3: [TypeAccess] Y
# 38| 6: [Class] Z
#-----| -3: (Annotations)
# 38| 1: [Annotation] Annot0k
# 0| 1: [IntegerLiteral] 1
# 39| 2: [Annotation] Annot1k
# 0| 1: [IntegerLiteral] 2
# 0| 1: [StringLiteral] ab
# 0| 1: [StringLiteral] "ab"
# 0| 1: [TypeLiteral] X.class
# 0| 0: [TypeAccess] X
# 0| 1: [VarAccess] B
# 0| 1: [VarAccess] Y.B
# 0| -1: [TypeAccess] Y
# 0| 1: [ArrayInit] {...}
# 0| 1: [VarAccess] C
# 0| 1: [VarAccess] A
# 0| 1: [VarAccess] Y.C
# 0| -1: [TypeAccess] Y
# 0| 1: [VarAccess] Y.A
# 0| -1: [TypeAccess] Y
# 0| 1: [Annotation] Annot0k
# 0| 1: [IntegerLiteral] 1
# 42| 1: [Constructor] Z
#-----| 1: (Annotations)
# 41| 1: [Annotation] Annot0k
# 0| 1: [IntegerLiteral] 0
# 41| 5: [BlockStmt] { ... }
# 42| 0: [SuperConstructorInvocationStmt] super(...)
# 42| 1: [BlockStmt] { ... }

View File

@@ -14,12 +14,17 @@ annotationDeclarations
| def.kt:23:1:31:1 | Annot1k | def.kt:29:5:29:32 | e |
| def.kt:23:1:31:1 | Annot1k | def.kt:30:5:30:31 | f |
annotations
| annotation_classes.testproj/test.class.files/Annot1k.class:0:0:0:0 | Annot0k | def.kt:23:1:31:1 | Annot1k | def.kt:5:1:21:60 | Annot0k |
| def.kt:0:0:0:0 | Annot0k | def.kt:39:1:39:40 | Annot1k | def.kt:5:1:21:60 | Annot0k |
| def.kt:23:1:23:8 | Annot0k | def.kt:23:1:31:1 | Annot1k | def.kt:5:1:21:60 | Annot0k |
| def.kt:38:1:38:17 | Annot0k | def.kt:38:1:43:1 | Z | def.kt:5:1:21:60 | Annot0k |
| def.kt:39:1:39:40 | Annot1k | def.kt:38:1:43:1 | Z | def.kt:23:1:31:1 | Annot1k |
| def.kt:41:5:41:12 | Annot0k | def.kt:42:5:42:19 | Z | def.kt:5:1:21:60 | Annot0k |
| def.kt:45:1:45:8 | Annot0k | def.kt:46:1:51:1 | fn | def.kt:5:1:21:60 | Annot0k |
| def.kt:46:21:46:28 | Annot0k | def.kt:46:21:46:39 | a | def.kt:5:1:21:60 | Annot0k |
| def.kt:54:1:54:12 | Annot0k | def.kt:57:1:57:23 | getP | def.kt:5:1:21:60 | Annot0k |
| def.kt:55:1:55:12 | Annot0k | def.kt:57:1:57:23 | setP | def.kt:5:1:21:60 | Annot0k |
| def.kt:56:1:56:14 | Annot0k | def.kt:53:1:57:23 | p | def.kt:5:1:21:60 | Annot0k |
| def.kt:59:5:59:21 | Annot0k | def.kt:59:5:59:28 | <this> | def.kt:5:1:21:60 | Annot0k |
| use.java:10:5:10:21 | Annot0j | use.java:14:18:14:18 | Z | Annot0j.java:1:19:1:25 | Annot0j |
| use.java:11:5:11:90 | Annot1j | use.java:14:18:14:18 | Z | Annot1j.java:1:19:1:25 | Annot1j |
| use.java:11:73:11:89 | Annot0j | use.java:11:5:11:90 | Annot1j | Annot0j.java:1:19:1:25 | Annot0j |
@@ -28,16 +33,26 @@ annotations
| use.java:13:73:13:87 | Annot0k | use.java:13:5:13:88 | Annot1k | def.kt:5:1:21:60 | Annot0k |
annotationValues
| def.kt:0:0:0:0 | Annot0k | def.kt:0:0:0:0 | 1 |
| def.kt:0:0:0:0 | Retention | def.kt:0:0:0:0 | RetentionPolicy.RUNTIME |
| def.kt:0:0:0:0 | Retention | def.kt:0:0:0:0 | RetentionPolicy.RUNTIME |
| def.kt:0:0:0:0 | Target | def.kt:0:0:0:0 | {...} |
| def.kt:5:1:20:1 | Target | def.kt:0:0:0:0 | {...} |
| def.kt:21:26:21:42 | JvmName | def.kt:0:0:0:0 | "a" |
| def.kt:23:1:23:8 | Annot0k | def.kt:0:0:0:0 | 0 |
| def.kt:38:1:38:17 | Annot0k | def.kt:0:0:0:0 | 1 |
| def.kt:39:1:39:40 | Annot1k | def.kt:0:0:0:0 | 2 |
| def.kt:39:1:39:40 | Annot1k | def.kt:0:0:0:0 | "ab" |
| def.kt:39:1:39:40 | Annot1k | def.kt:0:0:0:0 | Annot0k |
| def.kt:39:1:39:40 | Annot1k | def.kt:0:0:0:0 | B |
| def.kt:39:1:39:40 | Annot1k | def.kt:0:0:0:0 | X.class |
| def.kt:39:1:39:40 | Annot1k | def.kt:0:0:0:0 | ab |
| def.kt:39:1:39:40 | Annot1k | def.kt:0:0:0:0 | Y.B |
| def.kt:39:1:39:40 | Annot1k | def.kt:0:0:0:0 | {...} |
| def.kt:41:5:41:12 | Annot0k | def.kt:0:0:0:0 | 0 |
| def.kt:45:1:45:8 | Annot0k | def.kt:0:0:0:0 | 0 |
| def.kt:46:21:46:28 | Annot0k | def.kt:0:0:0:0 | 0 |
| def.kt:54:1:54:12 | Annot0k | def.kt:0:0:0:0 | 0 |
| def.kt:55:1:55:12 | Annot0k | def.kt:0:0:0:0 | 0 |
| def.kt:56:1:56:14 | Annot0k | def.kt:0:0:0:0 | 0 |
| def.kt:59:5:59:21 | Annot0k | def.kt:0:0:0:0 | 0 |
| use.java:10:5:10:21 | Annot0j | use.java:10:20:10:20 | 1 |
| use.java:11:5:11:90 | Annot1j | use.java:11:18:11:18 | 1 |
| use.java:11:5:11:90 | Annot1j | use.java:11:25:11:28 | "ac" |

View File

@@ -16,5 +16,5 @@ query predicate annotations(Annotation a, Element e, AnnotationType at) {
}
query predicate annotationValues(Annotation a, Expr v) {
a.getAValue() = v and v.getFile().isSourceFile()
a.getValue(_) = v and v.getFile().isSourceFile()
}

View File

@@ -60,3 +60,6 @@ fun @receiver:Annot0k String.myExtension() { }
@Annot0k
typealias AAA = Z
// Diagnostic Matches: Incomplete annotation: @kotlin.annotation.Target(%)
// Diagnostic Matches: Incomplete annotation: @kotlin.jvm.JvmName(%)