Skip to content

Problem with table keys with union types #1273

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

Closed
NeOzay opened this issue Jul 3, 2022 · 0 comments
Closed

Problem with table keys with union types #1273

NeOzay opened this issue Jul 3, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@NeOzay
Copy link
Contributor

NeOzay commented Jul 3, 2022

Describe the bug

---@type table<string|number, string>
local t

---@type number
local n
---@type string
local s

local test  = t[n] 
local test2 = t[s] --test and test2 are unknow

t[1] and t[" "] work

Environment:

  • OS: Windows
  • Client: VSCode
  • Version: last release
@sumneko sumneko added the bug Something isn't working label Jul 4, 2022
@sumneko sumneko closed this as completed in f732640 Jul 4, 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
Projects
None yet
Development

No branches or pull requests

2 participants