Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generic class instanced in function should return as a concrete type #1856

Open
eigenbom opened this issue Jan 29, 2023 · 0 comments
Open

Generic class instanced in function should return as a concrete type #1856

eigenbom opened this issue Jan 29, 2023 · 0 comments
Labels
feat/generic Related to generic emulation feature

Comments

@eigenbom
Copy link

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?

Annotations, Hover

Expected Behaviour

Actual Behaviour

Hovering strings in this code below gives the type as local strings: list<<T>>|{ [integer]: string }, whereas I expect the type/hover to be local strings: list<T>.

---@class list<T>: {[integer]:T}

---@generic T
---@param class `T`
---@return list<T>
local function new_list(class)
	return {}
end

local strings = new_list('string')

Reproduction steps

Additional Notes

No response

Log File

No response

@carsakiller carsakiller added the feat/generic Related to generic emulation feature label Jan 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat/generic Related to generic emulation feature
Projects
None yet
Development

No branches or pull requests

2 participants