You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Incorrect types used for overloaded class when passed as argument #3274
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.
---@paramffunctionlocalfunctioncall(f) f() end---@classfoo---@overloadfun()localsomething=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
Activity