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
In the example above, Lua LS should report a param-type-mismatch diagnostic for test(x). It has enough information to know that x cannot be of type Foo, at the very least because it is missing FooField.
We see that test({z=1}) correctly reports the param-type-mismatch diagnostic.
Actual Behaviour
No error is reported.
Reproduction steps
In any editor with Lua LS installed, write the provided code. Observe that there are no squiggles reported.
Additional Notes
I would say this is a pretty serious bug. I would have expected Lua LS's type checking to be robust enough to handle checking the types of variables. It seems that all it is doing is checking that the type is a table.
IS this because there is no narrowing of variables once they become tables? This is only done for table literals?
Log File
No response
The text was updated successfully, but these errors were encountered:
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
In the example above, Lua LS should report a param-type-mismatch diagnostic for
test(x)
. It has enough information to know that x cannot be of type Foo, at the very least because it is missingFooField
.We see that test({z=1}) correctly reports the param-type-mismatch diagnostic.
Actual Behaviour
No error is reported.
Reproduction steps
In any editor with Lua LS installed, write the provided code. Observe that there are no squiggles reported.
Additional Notes
I would say this is a pretty serious bug. I would have expected Lua LS's type checking to be robust enough to handle checking the types of variables. It seems that all it is doing is checking that the type is a table.
IS this because there is no narrowing of variables once they become tables? This is only done for table literals?
Log File
No response
The text was updated successfully, but these errors were encountered: