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
Especially usefull for save function calls, returning nil, err on failure.
If I add logic, the issue just wanders of, like an entangled particle.
So the solution is to @casterr to string, but I wonder if maybe a mutual exclusive return type is more appropriate. It could solve this issue and others too.
I dunno what a convinient syntax would be, something along those lines:
---@parampathstring---@parammodestring---@returnfile* | (nil, string)functionio.open(path, mode) end
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Especially usefull for save function calls, returning nil, err on failure.

If I add logic, the issue just wanders of, like an entangled particle.
So the solution is to
@cast
err
tostring
, but I wonder if maybe a mutual exclusive return type is more appropriate. It could solve this issue and others too.I dunno what a convinient syntax would be, something along those lines:
Beta Was this translation helpful? Give feedback.
All reactions