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

SC2034 is not muted by valid [[ -v ... ]] tests against associative arrays #1107

Open
ghost opened this issue Feb 5, 2018 · 0 comments
Open

Comments

@ghost
Copy link

ghost commented Feb 5, 2018

The following code triggers SC2034 in version 0.4.7 and the online version.

#!/bin/bash
declare -A var=([a]="")
for x in a b c; do
        [[ -v "var[$x]" ]]
        echo $?
done

My expectation would be that it does not do so, because the test for an existing key is valid, and obviously references the variable in question.

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

0 participants