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

Selene mistakes variables as being 'shadowed' in some situations with anonymous functions in events #116

Open
NobleDraconian opened this issue Jun 6, 2020 · 1 comment
Labels
A-lints Area: Relating to a lint directly C-bug Category: Bug

Comments

@NobleDraconian
Copy link

NobleDraconian commented Jun 6, 2020

Currently (with selene 0.6.0), selene will mistake an event parameter as being 'shadowed' if an anonymous function is used in an event connection, and a previous event connection uses the same variable name. I was unfortunately not able to get a solid reproduction when I tried reproducing the issue.
image

@Kampfkarren Kampfkarren added A-lints Area: Relating to a lint directly C-bug Category: Bug labels Jun 6, 2020
@Dekkonot
Copy link
Contributor

Dekkonot commented Aug 2, 2020

Actual problem: if there is an empty else block, it causes problem with the shadowing lint. Easy repro:

local foo = function(bar)
    if bar then
        print(bar)
    else
        -- This causes problems
    end
end

local baz = function(bar)
    print(bar)
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lints Area: Relating to a lint directly C-bug Category: Bug
Projects
None yet
Development

No branches or pull requests

3 participants