Fix parsing of [$var] (fixes #2309)

This commit is contained in:
Vidar Holen 2021-08-26 23:05:14 -07:00
parent ecacc2e9bb
commit 081f7eba24
5 changed files with 54 additions and 19 deletions

View file

@ -2311,6 +2311,8 @@ prop_checkUnused45= verifyTree checkUnusedAssignments "readonly foo=bar"
prop_checkUnused46= verifyTree checkUnusedAssignments "readonly foo=(bar)"
prop_checkUnused47= verifyNotTree checkUnusedAssignments "a=1; alias hello='echo $a'"
prop_checkUnused48= verifyNotTree checkUnusedAssignments "_a=1"
prop_checkUnused49= verifyNotTree checkUnusedAssignments "declare -A array; key=a; [[ -v array[$key] ]]"
checkUnusedAssignments params t = execWriter (mapM_ warnFor unused)
where
flow = variableFlow params