Do not report "Declaration hides variable" for unnamed variables

This commit is contained in:
Jeroen Ketema
2022-01-26 15:10:37 +01:00
parent 10a94cfa45
commit 9194af9b15
3 changed files with 4 additions and 5 deletions

View File

@@ -18,6 +18,7 @@ where
not lv1.isCompilerGenerated() and
not lv2.isCompilerGenerated() and
not lv1.getParentScope().(BlockStmt).isInMacroExpansion() and
not lv2.getParentScope().(BlockStmt).isInMacroExpansion()
not lv2.getParentScope().(BlockStmt).isInMacroExpansion() and
not lv1.getName() = "(unnamed local variable)"
select lv1, "Variable " + lv1.getName() + " hides another variable of the same name (on $@).", lv2,
"line " + lv2.getLocation().getStartLine().toString()