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
Annotations, Type Checking, Diagnostics/Syntax Checking
Expected Behaviour
Should be a type error to not include all required fields from both parent and child class.
Actual Behaviour
Only fields from the child class are required.
With an empty table, we get a warning about missing the fields from the child class:
When we fill in those fields, we get no warnings, even though the fields from the parent class are still missing:
If we explicitly assign nil, we do get warnings:
Reproduction steps
Check the diagnostics for the following snippets:
---@classParent---@fieldastring---@fieldbstring---@classChild:Parent---@fieldcstring---@fielddstring---@typeChildlocalmy_child= {} -- We get a warning here saying `c` and `d` are missing
---@classParent---@fieldastring---@fieldbstring---@classChild:Parent---@fieldcstring---@fielddstring---@typeChildlocalmy_child= {
c='c',
d='d',
} -- but no diagnostics here, even though `a` and `b` are missing
Additional Notes
No response
Log File
No response
The text was updated successfully, but these errors were encountered:
b0o
changed the title
Missing fields on inherited class not yielding diagnostics warnings
Missing fields on inherited class not resulting in diagnostics warnings
Apr 5, 2024
How are you using the lua-language-server?
NeoVim
Which OS are you using?
Linux
What is the issue affecting?
Annotations, Type Checking, Diagnostics/Syntax Checking
Expected Behaviour
Should be a type error to not include all required fields from both parent and child class.
Actual Behaviour
Only fields from the child class are required.
With an empty table, we get a warning about missing the fields from the child class:
When we fill in those fields, we get no warnings, even though the fields from the parent class are still missing:
If we explicitly assign
nil
, we do get warnings:Reproduction steps
Check the diagnostics for the following snippets:
Additional Notes
No response
Log File
No response
The text was updated successfully, but these errors were encountered: