@@ -23,8 +23,7 @@ predicate keyValueCommentAt(string filepath, int line, string key, string value)
2323module VariableAccessTest implements TestSig {
2424 string getARelevantTag ( ) { result = "access" }
2525
26- private predicate declAt ( Variable v , string filepath , int line ) {
27- v .getLocation ( ) .hasLocationInfo ( filepath , _, _, line , _)
26+ additional predicate declAt ( Variable v , string filepath , int line ) {
2827 v .getLocation ( ) .hasLocationInfo ( filepath , line , _, _, _)
2928 }
3029
@@ -50,3 +49,13 @@ module VariableAccessTest implements TestSig {
5049}
5150
5251import MakeTest< VariableAccessTest >
52+
53+ private Variable getVariableAt ( string name , string filepath , int line ) {
54+ VariableAccessTest:: declAt ( result , filepath , line ) and
55+ result .getName ( ) = name
56+ }
57+
58+ query predicate ambiguousVariable ( Variable v , string name , string filepath , int line ) {
59+ v = getVariableAt ( name , filepath , line ) and
60+ strictcount ( getVariableAt ( name , filepath , line ) ) >= 2
61+ }
0 commit comments