@@ -41,7 +41,12 @@ predicate gapInChildren(Element e, int i) {
41
41
// -1 can be skipped (type arguments from -2 down, no qualifier at -1,
42
42
// then arguments from 0).
43
43
// Can we also skip arguments, e.g. due to defaults for parameters?
44
- not ( e instanceof MethodAccess and e .getFile ( ) .isKotlinSourceFile ( ) )
44
+ not ( e instanceof MethodAccess and e .getFile ( ) .isKotlinSourceFile ( ) ) and
45
+ // Kotlin-extracted annotations can have missing children where a default
46
+ // value should be, because kotlinc doesn't load annotation defaults and we
47
+ // want to leave a space for another extractor to fill in the default if it
48
+ // is able.
49
+ not e instanceof Annotation
45
50
}
46
51
47
52
predicate lateFirstChild ( Element e , int i ) {
@@ -59,7 +64,12 @@ predicate lateFirstChild(Element e, int i) {
59
64
not ( e instanceof LocalVariableDeclStmt and i = 1 and not exists ( nthChildOf ( e , 2 ) ) ) and
60
65
// For statements may or may not declare a new variable (child 0), or
61
66
// have a condition (child 1).
62
- not ( e instanceof ForStmt and i = [ 1 , 2 ] )
67
+ not ( e instanceof ForStmt and i = [ 1 , 2 ] ) and
68
+ // Kotlin-extracted annotations can have missing children where a default
69
+ // value should be, because kotlinc doesn't load annotation defaults and we
70
+ // want to leave a space for another extractor to fill in the default if it
71
+ // is able.
72
+ not e instanceof Annotation
63
73
}
64
74
65
75
from Element e , int i , string problem
0 commit comments