Open
Description
How are you using the lua-language-server?
Visual Studio Code Extension (sumneko.lua)
Which OS are you using?
Windows
What is the issue affecting?
Type Checking
Expected Behaviour
Some warning should be raised if you use [5] on a table<string, x>, for example.
Actual Behaviour
In the expression tbl[x]
, the type of x is not checked at all
Reproduction steps
---@type table<integer, string> -- or string[]
local IntStr = {}
---@type table<string, integer>
local StrInt = {}
IntStr[5] = "hi" -- ok
IntStr["a"] = "b" -- "a" should produce a warning
StrInt["a"] = 5 -- ok
StrInt[5] = 6 -- 5 should produce a warning
Additional Notes
Probably related to #1861
Log File
No response