fix: skip redundant-parameter check when last arg is multi-return call#1014
Open
EfveZombie wants to merge 2 commits intoEmmyLuaLs:mainfrom
Open
fix: skip redundant-parameter check when last arg is multi-return call#1014EfveZombie wants to merge 2 commits intoEmmyLuaLs:mainfrom
EfveZombie wants to merge 2 commits intoEmmyLuaLs:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates the parameter count diagnostic to account for multi-return function calls, such as table.unpack, when used as the final argument in a call. This change prevents false positives for redundant parameters. Feedback suggests narrowing the detection logic to specifically check for CallExpr types, as other variadic expressions in Lua do not expand into multiple values in that position.
crates/emmylua_code_analysis/src/diagnostic/checker/check_param_count.rs
Show resolved
Hide resolved
added 2 commits
April 10, 2026 22:25
…l, for avoiding false positives with table.unpack
e2a97e3 to
0ab12e8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Skip the redundant-parameter diagnostic when the last argument is a multi-return function call (e.g.
table.unpack), avoiding false positives.