lua-language-server icon indicating copy to clipboard operation
lua-language-server copied to clipboard

Cannot infer value type

Open Nexela opened this issue 3 years ago • 1 comments

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

image bug.log

Nexela avatar Jul 18 '22 00:07 Nexela

This is caused by the current generic implementation defect, and the generic implementation needs to be refactored in the future.

sumneko avatar Jul 19 '22 02:07 sumneko