Skip to content

Conversation

@Rathoz
Copy link
Contributor

@Rathoz Rathoz commented Feb 19, 2025

Using os.time() with an osdate type input is currently not allowed, only osdateparam is allowed.

---@type osdate
local date
dosomething(os.time(date))
--- Cannot assign `osdate` to parameter `osdateparam?`.
--- - `osdate` cannot match `osdateparam?`
--- - Type `osdate` cannot match `nil`
--- - Type `osdate` cannot match `osdateparam`Lua Diagnostics.(param-type-mismatch)

This simple change makes so that osdate is a child of osdateparam, and as such can be used in all curcumstances an osdateparam would be acceptable.

@sumneko sumneko merged commit 64c7084 into LuaLS:master Feb 21, 2025
10 of 11 checks passed
@Rathoz Rathoz deleted the patch-1 branch February 21, 2025 08:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants