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 generic inference on function return #1111
---@genericT---@paramfov (fun(...): T | nil)---@param ... unknownparams for function---@returnT | nil---@overloadfun(fov: T): Tfunctionfn_or_val(fov, ...) returntype(fov) =='function' andfov(...) orfovendlocalfn=function() returnmath.random() >0.5and'foo' ornilend-- foo is expected to be string?-- but inferred as fun() -> "foo"?localfoo=fn_or_val(fn)
-- inferred as string, correctlocalbar=fn_or_val('foo')
Activity
fix: prefer main signature for tied overload matches