Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SC2199 appears to incorrectly error on e.g., "${@:2:1}" expansion of "$@" #3118

Open
1 task done
iconoclasthero opened this issue Jan 9, 2025 · 0 comments
Open
1 task done

Comments

@iconoclasthero
Copy link

For bugs

  • Rule Id SC2199
  • online
  • I tried on shellcheck.net and verified that this is still a problem on the latest commit

the error message:

[ "${@:2:1}" ]] && printf '               %s\n' "${@:2}"
   ^-- [SC2199](https://www.shellcheck.net/wiki/SC2199) (error): Arrays implicitly concatenate in [[ ]]. Use a loop (or explicit * instead of @).

Appears to miss the fact that this is a single value and there's no concatenation possible, i.e., because of the special case of "$@".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant