Closed
Description
In the following snippet, auto completion is lost on a table after inferring its type by index
--- @diagnostic disable: unused-local
--- @class Test2
--- @field world integer
local Test2 = {}
--- @type Test2
local tdirect
--- @type Test2[]
local tarray
-- Direct inference
local b = tdirect -- type . here, shows "world"
-- Inferred by literal index
local c = tarray[1] -- type . here, no auto completion
When hovering it can be seen that the table loses its fields when inferred by literal index
Environment:
- OS: Windows
- Client: VSCode
- Extension version: 2.0.2