Skip to content

Returned Object type array isnt working #274

Closed
@Maxxxel

Description

@Maxxxel
---@class Object
---@field a string
---@field GetObjects function
local Object = {}

---@return Object[]
function Object:GetObjects() end

local O = Object:GetObjects()

for i = 1, #O do
    local o = O[1]
    print(o.a)
end

for key, value in pairs(Object:GetObjects()) do
    print(key, value.a)
end

Results for *.a:
https://gyazo.com/1ae1e0dbbbd626b69df6227c75e642ab
https://gyazo.com/96c947f45723f84b1f4452e07325d68a

Expected results + manual fix:

It seems like

---@return type[]

Doesent work properly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingfeat/LuaCats AnnotationsRelated to Lua Language Server Annotations (LuaCats)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions