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
I'd expect tables created in the return statement to check for missing fields, and those created outside of them to check for injected fields.
Actual Behaviour
There are no warnings emitted for the attached code.
Reproduction steps
Code to reproduce the issue:
---@classTile---@fieldnamestringlocalTile= {}
---@returnTilefunctionTile.new()
---@typeTilelocald= {
name='abc',
f=10-- No warning when a field is being injected
}
return {
f=10-- No warning even though there's a missing field and a field is being injected
}
end
Note that it won't produce any warnings, regardless of configuration (as far as I can tell).
Additional Notes
No response
Log File
No response
The text was updated successfully, but these errors were encountered:
The checking of return-type-mismatch for table literal is added recently in #2768. But seems it is too strict so it is disabled by default. You have to enable it by using "type.checkTableShape": true in your .luarc.json or whatever settings file that you used.
But, only half of the problem is solved 😂 . Because it only checks for missing fields but not extra fields
As for the inject field check, there seems to be some similar issues:
How are you using the lua-language-server?
Visual Studio Code Extension (sumneko.lua)
Which OS are you using?
Linux
What is the issue affecting?
Type Checking
Expected Behaviour
I'd expect tables created in the return statement to check for missing fields, and those created outside of them to check for injected fields.
Actual Behaviour
There are no warnings emitted for the attached code.
Reproduction steps
Code to reproduce the issue:
Note that it won't produce any warnings, regardless of configuration (as far as I can tell).
Additional Notes
No response
Log File
No response
The text was updated successfully, but these errors were encountered: