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

Undefined variable is not reported #1907

Closed
horkhe opened this issue Oct 7, 2015 · 2 comments
Closed

Undefined variable is not reported #1907

horkhe opened this issue Oct 7, 2015 · 2 comments
Assignees
Milestone

Comments

@horkhe
Copy link
Contributor

horkhe commented Oct 7, 2015

func test(ch chan string) string {
    select {
    case s := <- ch:
    }
    return s  // Should be reported error: `undefined: s`
}

Plugin version: 0.9.530

@dlsniper dlsniper added this to the 1.0.0 milestone Oct 7, 2015
@dlsniper
Copy link
Member

dlsniper commented Oct 7, 2015

@ignatov I've labeled this as an inspection issue but I think it's more closely to a resolving issue as it seems the value of s from return s is resolved to the declaration in the case s := <- ch: expression and it shouldn't.

@horkhe thanks for reporting.

@horkhe
Copy link
Contributor Author

horkhe commented Oct 7, 2015

The pleasure is all mine, as always :)

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