Skip to content

模板参数类型推断问题 #3061

@luqingyang

Description

@luqingyang

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

Image

Actual Behaviour

Image

Reproduction steps

---@Class A
local A = {}

---@Class B : A
local B = {}

---@Generic T : A
---@param name string
---@param baseClazz? T
---@return T
function test(name, baseClazz)
end

local c = test("c")

===以上代码,最后一行c的类型推导有问题

Additional Notes

No response

Log File

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions