Skip to content

Wrong return type #2079

@maattch

Description

@maattch

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, Completion, Diagnostics/Syntax Checking

Expected Behaviour

I had to rollback to version 3.6.4 where it was working
correct

Actual Behaviour

If you have a function with the same name as the class, and return the class, the return type is not being recognized.
wrong

Reproduction steps

Define the global class in a separated file and try to use it elsewhere

---@class Dummy
Dummy = {}

---@param id integer
---@return Dummy
function Dummy(id) end

---@return string
function Dummy:getFoo() end

---@return integer
function Dummy:getBar() end

Additional Notes

No response

Log File

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionUser has a question

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions