LuaLS / LuaLS/lua-language-server
Adding an overload to an @class changes the result and gives type errors.
Nobody has claimed this yet.
- Dominant language
- Lua
- Stars
- 4.4k
- Forks
- 442
- PR merge metrics
- No merged PRs in 30d
Description
### How are you using the lua-language-server?
Visual Studio Code Extension (sumneko.lua)
### Which OS are you using?
Linux
### What is the issue affecting?
Type Checking
### Expected Behaviour
Adding an Overload under ---@class should not change anything about how the type is handled.
### Actual Behaviour

Here we have a class declaration and it's exactly how I want.

Adding an overload for the constructor generates warnings? Doesn't really make any sense.
### Reproduction steps
Use ---@class to define a class.
Add ---@overload.
Make sure the class library you're using returns anything but any when extending or creating a new class.
### Additional Notes
_No response_
### Log File
_No response_
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The payload names no source file or test; start by reproducing the case in the Visual Studio Code extension with a Lua `---@class` declaration and `---@overload`, then compare type-checking results with and without the overload. Trace the class and constructor handling involved, and consider the issue resolved when adding the overload no longer changes valid type handling or produces the reported warnings.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua, vscode
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100