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

always_use_return bug with if statement #888

Open
edward-bestx opened this issue Nov 29, 2024 · 0 comments
Open

always_use_return bug with if statement #888

edward-bestx opened this issue Nov 29, 2024 · 0 comments

Comments

@edward-bestx
Copy link

The following code snippet shows a bug when always_use_return is enabled:

module ExampleModule

global switch = false

function example()
    if switch
        1
    end
end

function example2()
    1
end

end

The second function will add a return statement, the first will not. This is despite the fact that the first function returns either 1 or nothing, depending on the value of switch.

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

1 participant