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

suport #[must_use] annotation for function calls whose return value must be read #266

Closed
matthargett opened this issue Jun 23, 2021 · 0 comments · Fixed by #381
Closed
Labels
A-standard-library Area: Standard Library C-enhancement Category: Feature request or improvement

Comments

@matthargett
Copy link
Contributor

I had this bug today:

bit32.bor(fallbackColdFigment.flags, Emplacement)
return fallbackColdFigment.flags

which should have been

fallbackColdFigment.flags = bit32.bor(fallbackColdFigment.flags, Emplacement)
return fallbackColdFigment.flags

it would be nice if we could annotate the bit32 functions in the rule toml files to require the return value to be stored/read so it would have told me about the bug. Similarly, I would expect this potential bug to be found:

local fallbackColdFigment = bit32.bor(fallbackColdFigment.flags, Emplacement)
return fallbackColdFigments

where the return value is stored, but not read

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-standard-library Area: Standard Library C-enhancement Category: Feature request or improvement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants