Skip to content

A used private variable is reported as assigned but never used #413

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

Closed
nightroman opened this issue Dec 23, 2015 · 1 comment
Closed

A used private variable is reported as assigned but never used #413

nightroman opened this issue Dec 23, 2015 · 1 comment
Assignees
Milestone

Comments

@nightroman
Copy link

For the script like

$private:x = 42
$x

Invoke-ScriptAnalyzer reports

RuleName                            Severity     FileName   Line  Message
--------                            --------     --------   ----  -------
PSUseDeclaredVarsMoreThanAssigments Warning      test.ps1   1     The variable 'private:x' is assigned but never used.

This is not quite right because the variable is used in the next line after assignment.

@quoctruong
Copy link

Thanks for the report. This is fixed with #424

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

No branches or pull requests

3 participants