-
-
Notifications
You must be signed in to change notification settings - Fork 339
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@deprecated
is ignored on globals when assigned by another global
#3074
Comments
@deprecated
to be applied to globals (and classes)@deprecated
is ignored on globals when assigned by another global
From maintainer's comment of another issue: #2784 (comment)
(translated by chatgpt) When assigning a global to another global, there exists two definition for that variable:
While when assigning a local to global, seems that it is not considered as a definition of that global.
IIUC, this is by design: as long as one of the definitions is not marked as deprecated, the entire object is not considered deprecated. In addition, from wiki the |
Thanks for the explanation. I'd need to look into it more to decide whether this behavior is sensible. In my case I was able to work around it this way: ---@class Foo
local foo = {}
---@deprecated
GlobalFoo = nil ---@type Foo
I noticed this too. |
meta.lua
test.lua
Interestingly the deprecation is shown correctly in the autocomplete:
The text was updated successfully, but these errors were encountered: