@@ -60,17 +60,12 @@ query predicate multipleChildren(Element parent, int index, Element child1, Elem
6060}
6161
6262/**
63- * Holds if `child` has multiple positions amongst the `accessor` children
64- * of `parent`.
65- *
66- * Children are allowed to have multiple positions for _different_ accessors,
67- * for example in an array repeat expression `[1; 10]`, `1` has positions for
68- * both `getRepeatOperand()` and `getExpr()`.
63+ * Holds if `child` has multiple positions amongst the children of `parent`.
6964 */
70- query predicate multiplePositions ( Element parent , int pos1 , int pos2 , string accessor , Element child ) {
71- child = getChildAndAccessor ( parent , pos1 , accessor ) and
72- child = getChildAndAccessor ( parent , pos2 , accessor ) and
73- pos1 != pos2
65+ query predicate multiplePositions ( Element parent , int pos1 , int pos2 , Element child ) {
66+ child = getChildAndAccessor ( parent , pos1 , _ ) and
67+ child = getChildAndAccessor ( parent , pos2 , _ ) and
68+ pos1 < pos2
7469}
7570
7671/**
@@ -97,5 +92,5 @@ int getAstInconsistencyCounts(string type) {
9792 result = count ( Element e | multipleChildren ( _, _, e , _) | e )
9893 or
9994 type = "Multiple positions" and
100- result = count ( Element e | multiplePositions ( _, _, _, _ , e ) | e )
95+ result = count ( Element e | multiplePositions ( _, _, _, e ) | e )
10196}
0 commit comments