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
function add_month(time)
local dt = os.date('*t', time)
dt.month = dt.month + 1
return os.time(dt)
end
And the warning itself:
The code seems to be working. Apparently, the extension understands that the type of dt variable is either string or osdate. It also knows that os.date function takes ostime as an argument:
It assumes that dt is a string and raises the warning but ignores the fact that it's also an osdate. Is this a bug or am I missing something?
The text was updated successfully, but these errors were encountered:
This is due to os.date returning either a string or table. It may be possible to provide an overload so that unless *t is provided as the first parameter, the return type is string... but that may not be possible right now.
In the meantime, you can @cast the return of os.date to a different type:
Here is the code that causes warning:
And the warning itself:


The code seems to be working. Apparently, the extension understands that the type of
dt
variable is eitherstring
orosdate
. It also knows thatos.date
function takesostime
as an argument:It assumes that
dt
is astring
and raises the warning but ignores the fact that it's also anosdate
. Is this a bug or am I missing something?The text was updated successfully, but these errors were encountered: