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 annotation doesn't restrict types #1663

Closed
SalavatR opened this issue Nov 2, 2022 · 0 comments
Closed

---@generic annotation doesn't restrict types #1663

SalavatR opened this issue Nov 2, 2022 · 0 comments
Labels
enhancement New feature or request feat/LuaCats Annotations Related to Lua Language Server Annotations (LuaCats)
Milestone

Comments

@SalavatR
Copy link
Contributor

SalavatR commented Nov 2, 2022

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?

Diagnostics/Syntax Checking

Expected Behaviour

---@Generic T:vector3|vector4 this annotation restrict types

Actual Behaviour

---@Generic T:vector3|vector4 this annotation does not restrict types, or i misunderstand something

Reproduction steps

---@Generic T:vector3|vector4
---@param v1 T first vector
---@param v2 T second vector
---@return T
function vmath.mul_per_elem(v1, v2) end

vmath.mul_per_elem("asd1", "asd") -- warning of wrong type using expected

Additional Notes

No response

Log File

No response

@sumneko sumneko added enhancement New feature or request feat/LuaCats Annotations Related to Lua Language Server Annotations (LuaCats) labels Nov 2, 2022
@sumneko sumneko added this to the 3.6.0 milestone Nov 2, 2022
@sumneko sumneko closed this as completed in 385235c Nov 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request feat/LuaCats Annotations Related to Lua Language Server Annotations (LuaCats)
Projects
None yet
Development

No branches or pull requests

2 participants