You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here's a snippet or screenshot that shows the problem:
#!/bin/bashppArrInd() {
local -n args="$1"printf'<%s>\n'"${args[@]}"
}
case"$1"in
0) main() {
local param=(foo bar)
ppArrInd param
};;
1) main() {
local param=(baz quz)
ppArrInd param
};;*) main() {
local param=(fizz buzz)
ppArrInd param
};;esac
main
Here's what shellcheck currently says:
SC2034 is triggered unless specifically it is disabled on the last definition of param
Here's what I wanted or expected to see:
Given that realizing that an array is passed by name is out-of-scope for SC2034, at least it should warn at each of the definition lines for param (either since it understands that these are distinct variables, or since "is later redefined" should not count as a usage -- I'd similarly expect x=1; x=2; x=3 to warn that each of these definitions of x are unused)
The text was updated successfully, but these errors were encountered:
For bugs
shellcheck --version
or "online"): 0.10.0Here's a snippet or screenshot that shows the problem:
Here's what shellcheck currently says:
SC2034
is triggered unless specifically it is disabled on the last definition ofparam
Here's what I wanted or expected to see:
Given that realizing that an array is passed by name is out-of-scope for
SC2034
, at least it should warn at each of the definition lines forparam
(either since it understands that these are distinct variables, or since "is later redefined" should not count as a usage -- I'd similarly expectx=1; x=2; x=3
to warn that each of these definitions ofx
are unused)The text was updated successfully, but these errors were encountered: