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

Unnecessary '0 results are excess arguments' warning #143

Closed
pouwelsjochem opened this issue Jan 4, 2023 · 1 comment
Closed

Unnecessary '0 results are excess arguments' warning #143

pouwelsjochem opened this issue Jan 4, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@pouwelsjochem
Copy link
Contributor

Environment

Name Version
IDEA version 2021.2.4
Luanalysis version 1.3.0
OS MacOS

Lua

Name Setting
Language level 5.2

Type Safety

Name Setting
Strict nil checks
Unknown type (any) is indexable ☑️
Unknown type (any) is callabale ☑️

What are the steps to reproduce this issue?

Have a method which accepts either 1 or 2 parameters by using an overload.

    local function returnTwoNumbers()
        return 1,2
    end

    ---@param _number1 number
    ---@param _number2 number
    ---@overload fun(_number1:number)
    local function acceptOneOrTwoNumbers(_number1, _number2)

    end

    acceptOneOrTwoNumbers(1, 2)
    acceptOneOrTwoNumbers(returnTwoNumbers())

What happens?

When passing 2 parameters manually there's no warning message, as expected.
However when using a function which returns 2 values, IntelliJ underlines the function call with the following warning: 0 results are excess arguments

What were you expecting to happen?

No warning to be given since its a valid function call.

@Benjamin-Dobell Benjamin-Dobell added the bug Something isn't working label Jan 4, 2023
@Benjamin-Dobell
Copy link
Owner

Good timing, as far as bug reports go. I'm working on #58, so fundamentally making a bunch of changes to parameter handling. Planning on making another official release toward the end of the week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants