From f73d6f233219ccf6528065eabd8347d4b9ea274c Mon Sep 17 00:00:00 2001 From: Jordan Atwood Date: Wed, 7 Feb 2018 17:50:55 -0800 Subject: [PATCH] Add test for `local` keyword in SC2154 Follow-up to koalaman/shellcheck#988 --- ShellCheck/Analytics.hs | 1 + 1 file changed, 1 insertion(+) diff --git a/ShellCheck/Analytics.hs b/ShellCheck/Analytics.hs index 4bc3d21..ea9d16e 100644 --- a/ShellCheck/Analytics.hs +++ b/ShellCheck/Analytics.hs @@ -1879,6 +1879,7 @@ prop_checkUnassignedReferences29= verifyNotTree checkUnassignedReferences "if [[ prop_checkUnassignedReferences30= verifyNotTree checkUnassignedReferences "if [[ -v foo[3] ]]; then echo ${foo[3]}; fi" prop_checkUnassignedReferences31= verifyNotTree checkUnassignedReferences "X=1; if [[ -v foo[$X+42] ]]; then echo ${foo[$X+42]}; fi" prop_checkUnassignedReferences32= verifyNotTree checkUnassignedReferences "if [[ -v \"foo[1]\" ]]; then echo ${foo[@]}; fi" +prop_checkUnassignedReferences33= verifyNotTree checkUnassignedReferences "f() { local -A foo; echo \"${foo[@]}\"; }" checkUnassignedReferences params t = warnings where (readMap, writeMap) = execState (mapM tally $ variableFlow params) (Map.empty, Map.empty) -- GitLab