Skip to content

os.time expected input is wrong #2235

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Rathoz opened this issue Jul 28, 2023 · 4 comments · Fixed by #2240
Closed

os.time expected input is wrong #2235

Rathoz opened this issue Jul 28, 2023 · 4 comments · Fixed by #2240

Comments

@Rathoz
Copy link
Contributor

Rathoz commented Jul 28, 2023

How are you using the lua-language-server?

Visual Studio Code Extension (sumneko.lua)

Which OS are you using?

Windows

What is the issue affecting?

Type Checking

Expected Behaviour

This should not be warning per the documentation of os.time()
image

Actual Behaviour

image
is giving warning

Reproduction steps

local date = os.time{year=2024, month=12, day=13}

Additional Notes

No response

Log File

No response

@GiuseppeIII
Copy link

GiuseppeIII commented Jul 28, 2023

Interesting. I think the return osdate table from os.date has to be different than the input osdate table on os.time. (with the return osdate not containing any optionals and the input osdate function containing multiple optionals). This is slightly gross :(

@carsakiller
Copy link
Collaborator

Thanks for the report, should be fixed now!

@lukasbestle
Copy link

Thanks for the quick fix. 😍

One question: Shouldn't wday and yday also be optional?

@carsakiller
Copy link
Collaborator

Good point! 😄

@carsakiller carsakiller reopened this Jul 31, 2023
carsakiller added a commit to carsakiller/lua-language-server that referenced this issue Jul 31, 2023
Closes `os.time` expected input is wrong LuaLS#2235
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 a pull request may close this issue.

4 participants