LuaLS / LuaLS/lua-language-server
Cannot infer value type
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
Latest Vscode, Latest Master
---@generic V: string
---@param list V[]
---@return {[V]: true}
util.list_to_map = function(list)
local map = {}
for k, value in pairs(list) do
map[value] = true
end
return map
end
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
Reproduce the inference failure in VS Code using the Lua snippet from the issue and inspect the attached bug.log for diagnostics. Trace the language-server handling of the generic V parameter and the returned map type; done when the example infers the value type without the reported error.
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
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 50/100
