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
With the 0.22.0 release, there are suddenly an extreme amount of warnings throughout our codebase which did not exist before; strange warnings such as:
localMyClass=class("MyClass") -- class uses the constructor attribute properlyreturnMyClass
--- different filelocalmyInstance=MyClass() -- WARNING: Cannot call expression of type `EditorDockTree`
and:
---@classMyOtherClass---@field__instanceMyClasslocalMyOtherClass=class("MyOtherClass")
MyOtherClass.__instance=MyClass() -- WARNING: Cannot assign `self` to `MyClass`
They seem to be related to the order in which things are loaded by EmmyLua; Minimal reproducible examples are very hard for us to create as these issues are very ephemeral.
It seems like the problem occurs when the "constructor defining function" (what uses @[constructor()] is "loaded" after an actual call to it.
Nonetheless, attached are two MREs which solely differ in filename; one that always has the problem, and one that never has the problem.
Do note that, when testing, only the "main" file should be opened in your IDE; opening one of other two make the issue not occur.
Code_-_Insiders_Q9uvpUDt9Z.mp4
It does seem like these issues have existed since the "constructor" attribute was added, but warnings for "Cannot call expression" did not exist prior. This system has never worked consistently for us, which is frustrating when our project relies heavily on it. We have noticed that, before this update, the constructor attribute would refuse to work most of the time. It has just not triggered warnings until now.
With the 0.22.0 release, there are suddenly an extreme amount of warnings throughout our codebase which did not exist before; strange warnings such as:
and:
They seem to be related to the order in which things are loaded by EmmyLua; Minimal reproducible examples are very hard for us to create as these issues are very ephemeral.
It seems like the problem occurs when the "constructor defining function" (what uses
@[constructor()]is "loaded" after an actual call to it.Nonetheless, attached are two MREs which solely differ in filename; one that always has the problem, and one that never has the problem.
warning.zip
no_warning.zip
Do note that, when testing, only the "main" file should be opened in your IDE; opening one of other two make the issue not occur.
Code_-_Insiders_Q9uvpUDt9Z.mp4
It does seem like these issues have existed since the "constructor" attribute was added, but warnings for "Cannot call expression" did not exist prior. This system has never worked consistently for us, which is frustrating when our project relies heavily on it. We have noticed that, before this update, the
constructorattribute would refuse to work most of the time. It has just not triggered warnings until now.Thank you.