Files
codeql/swift/ql/test/library-tests/ast/no_double_indexes.ql
Paolo Tranquilli 8f09485414 Swift: enhance PrintAst testing
The `ParentChild` tests have been generalized to test all `PrintAst`
by factoring out `PrintAstNode` into a separate file.

The `child.ql` and `parent.ql` tests have been removed as they are
subsumed by `PrintAst.ql`. Also, a new `no_parent_child_loops` is
added to detect back edges to a root node (back edges to a non-root
node are already detected by `no_double_parents.ql`).
2022-08-31 06:54:30 +02:00

9 lines
262 B
Plaintext

private import codeql.swift.printast.PrintAstNode
from PrintAstNode parent, int index1, int index2, PrintAstNode child
where
index1 != index2 and
parent.hasChild(child, index1, _) and
parent.hasChild(child, index2, _)
select parent, child, index1, index2