LuaLS / LuaLS/lua-language-server
---@return self
Open
Nobody has claimed this yet.
bug
feat/generic
- 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?
Windows
What is the issue affecting?
Type Checking
Expected Behaviour

Actual Behaviour

Reproduction steps
---@class Test1
local Test1 = {};
---@return self
function Test1:New()
return setmetatable({}, { __indeex = self });
end
---@class Test2 : Test1
local Test2 = {};
local test1 = Test1:New();
local test2 = Test2:New();
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
Start by running the Lua reproduction in the issue through the language server's type checking in the Visual Studio Code extension on Windows, then compare the inferred types for Test1:New() and Test2:New(). Done means the return annotation is handled consistently for the base and derived classes, with the reported type-checking mismatch resolved.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100