We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5e0961b commit 3d9bc6fCopy full SHA for 3d9bc6f
1 file changed
java/ql/consistency-queries/children.ql
@@ -51,6 +51,8 @@ predicate gapInChildren(Element e, int i) {
51
not (i = -1 and e instanceof PatternCase and not e.(PatternCase).isRule()) and
52
// Pattern case statements can have a gap at -3 when they have more than one pattern but no guard.
53
not (i = -3 and count(e.(PatternCase).getAPattern()) > 1 and not exists(e.(PatternCase).getGuard())) and
54
+ // Pattern case statements may have some missing type accesses, depending on the nature of the direct child
55
+ not ((i = -2 or i < -4) and e instanceof PatternCase) and
56
// Instanceof with a record pattern is not expected to have a type access in position 1
57
not (i = 1 and e.(InstanceOfExpr).getPattern() instanceof RecordPatternExpr) and
58
// RecordPatternExpr extracts type-accesses only for its LocalVariableDeclExpr children
0 commit comments