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
When assigning to a field which is already defined in one of it's supers, no injection should be used.
Actual Behaviour
Assigning to existing field is not possible as I effectively end up with two fields A.test and B.test.
The only valid workaround I know would be using setters in A.
Just disabling (exact) does not solve the issue, just disable the warning.
Reproduction steps
---@class (exact) A---@fieldtestnumberlocala= {}
functiona:init()
--This is fineself.test=0end---@class (exact) B:Alocalb= {}
functionb:init()
--This is an injection and thus invalidself.test=0end
Additional Notes
If shadowing a field is explicitly wanted, one can still define/type explicitly. But I think by default, no additional field should get injected.
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?
Diagnostics/Syntax Checking
Expected Behaviour
When assigning to a field which is already defined in one of it's supers, no injection should be used.
Actual Behaviour
Assigning to existing field is not possible as I effectively end up with two fields
A.test
andB.test
.The only valid workaround I know would be using setters in
A
.Just disabling (exact) does not solve the issue, just disable the warning.
Reproduction steps
Additional Notes
If shadowing a field is explicitly wanted, one can still define/type explicitly. But I think by default, no additional field should get injected.
Issue is a bit related to
@override
(#2569).Log File
No response
The text was updated successfully, but these errors were encountered: