Skip to content

Cannot infer value type #1341

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
Nexela opened this issue Jul 18, 2022 · 1 comment
Open

Cannot infer value type #1341

Nexela opened this issue Jul 18, 2022 · 1 comment
Labels
bug Something isn't working feat/generic Related to generic emulation feature

Comments

@Nexela
Copy link
Contributor

Nexela commented Jul 18, 2022

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

@sumneko sumneko added the bug Something isn't working label Jul 18, 2022
@sumneko sumneko modified the milestone: 3.5.0 Jul 18, 2022
@sumneko
Copy link
Collaborator

sumneko commented Jul 19, 2022

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

@sumneko sumneko added the feat/generic Related to generic emulation feature label Jul 21, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working feat/generic Related to generic emulation feature
Projects
None yet
Development

No branches or pull requests

2 participants