Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Cannot infer value type #1341

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in 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
  翻译: