-
-
Notifications
You must be signed in to change notification settings - Fork 339
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
overload doesn't seem to match correctly #2509
Comments
This was referenced Aug 24, 2024
I originally thought this is solved because I cannot reproduce it while working on PR #2822, but finally I found out it's the reproduction code not complete enough: Reproduction code---@class ffi.cdata*
---@class gccjit.RValue*
---@class gccjit.LValue*
---@class gccjit.Type*
---@overload fun(x: ffi.cdata*, type: "rvalue"): gccjit.RValue*
---@overload fun(x: ffi.cdata*, type: "lvalue"): gccjit.LValue*
---@overload fun(x: ffi.cdata*, type: "type"): gccjit.Type*
local function expect(x, type)
if type == "lvalue" then
return {} --[[@as gccjit.LValue*]]
elseif type == "rvalue" then
return {} --[[@as gccjit.RValue*]]
elseif type == "type" then
return {} --[[@as gccjit.Type*]]
end
end
---@type ffi.cdata*
local data
local a = expect(data, "rvalue")
--> gccjit.LValue*|gccjit.RValue*|gccjit.Type*, bad
local b = expect(data, "lvalue")
--> gccjit.LValue*, ok
local c = expect(data, "type")
--> gccjit.Type*, ok
(Unfortunately my #2822 cannot fix this |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How are you using the lua-language-server?
Visual Studio Code Extension (sumneko.lua)
Which OS are you using?
MacOS
What is the issue affecting?
Annotations, Type Checking
Expected Behaviour
Actual Behaviour
Reproduction steps
Additional Notes
No response
Log File
No response
The text was updated successfully, but these errors were encountered: