-
-
Couldn't load subscription status.
- Fork 384
Open
@NathanSnail
Description
How are you using the lua-language-server?
NeoVim
Which OS are you using?
Linux
What is the issue affecting?
Type Checking
Expected Behaviour
When a class which is overloaded as a function, if that class is passed as an argument to another function it should be checked as if it is a function if the argument has a function type.
---@param f function local function call(f) f() end ---@class foo ---@overload fun() local something = setmetatable({}, {__call = function () end}) call(something) -- <-- Here something should be treated as `fun()`
Actual Behaviour
The type of the class is treated as foo|fun() which results in a warning because foo does not match function.
Reproduction steps
- Create a class with an overload
- Pass it to another function which takes a function argument
- Observe that a warning is produced
Additional Notes
No response
Log File
No response
Metadata
Metadata
Assignees
Labels
No labels