-
-
Notifications
You must be signed in to change notification settings - Fork 383
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
使用---@Generic T:frame ---@return T
获取到的返回类型好像没办法继承到frame?
fun(T
):T 这种写法好像不生效,有什么类似的写法吗
Actual Behaviour
fun里好像没有办法写泛型
Reproduction steps
---@Generic T:frame
---@overload fun(name:T
):fun(params:table):frame.T
local newframe = setmetatable({},{
__index = frame,
__call = function(self,name)
local class = rawget(self,name)
if class and getmetatable(class) then
return function(param)
return frame(class,param)
end
end
end,
})
---@type frame.button
local a = newframe 'button' {
}
Additional Notes
有什么格式支持这种返回值吗
Log File
No response
Metadata
Metadata
Assignees
Labels
No labels