-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Open
Description
For bugs with existing features
- Rule Id: SC2190
- My shellcheck version: 0.11.0
- The rule's wiki page does not already cover this (e.g. https://shellcheck.net/wiki/SC2086)
- I tried on https://www.shellcheck.net/ and verified that this is still a problem on the latest commit
Here's a snippet or screenshot that shows the problem:
#!/usr/bin/env bash
# shellcheck disable=SC2034
declare -A assoc_array=(
# shellcheck disable=SC1003
['Legit array index with trailing backslash \']=value
)Here's what shellcheck currently says:
[Line 5:](javascript:setPosition(5, 5))
# shellcheck disable=SC1003
^-- [SC2190](https://www.shellcheck.net/wiki/SC2190) (warning): Elements in associative arrays need index, e.g. array=( [index]=value ) .
^-- [SC2190](https://www.shellcheck.net/wiki/SC2190) (warning): Elements in associative arrays need index, e.g. array=( [index]=value ) .
^-- [SC2190](https://www.shellcheck.net/wiki/SC2190) (warning): Elements in associative arrays need index, e.g. array=( [index]=value ) .
[Line 6:](javascript:setPosition(6, 49))
['Legit array index with trailing backslash \']=value
^-- [SC1003](https://www.shellcheck.net/wiki/SC1003) (info): Want to escape a single quote? echo 'This is how it'\''s done'.
Here's what I wanted or expected to see:
No issues detected!
Metadata
Metadata
Assignees
Labels
No labels