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

love.even.quit("restart") #1829

Closed
Immow opened this issue Jan 17, 2023 · 0 comments
Closed

love.even.quit("restart") #1829

Immow opened this issue Jan 17, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@Immow
Copy link

Immow commented Jan 17, 2023

How are you using the lua-language-server?

Visual Studio Code Extension (sumneko.lua)

Which OS are you using?

Windows

What is the issue affecting?

Annotations

Expected Behaviour

It should not give me a warning that this is incorrect syntax with love2D

love.event.quit("restart")

Actual Behaviour

Gives me this warning:

Cannot assign string to parameter number?.

  • string cannot match number?
  • Type string cannot match nil
  • Type string cannot match numberLua Diagnostics.(param-type-mismatch)

Reproduction steps

On version v3.6.6 of Sumneko Lua gives me a warning with mentioned love2D function.

Additional Notes

in event.lua when I change

---@overload fun('restart': string|'restart')
---@param exitstatus? number # The program exit status to use when closing the application.
function love.event.quit(exitstatus) end

to

---@overload fun(restart: string|'restart')
---@param exitstatus? number # The program exit status to use when closing the application.
function love.event.quit(exitstatus) end

seems to solve the problem.

Log File

No response

@sumneko sumneko added the bug Something isn't working label Jan 17, 2023
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