lua-language-server
lua-language-server copied to clipboard
`@deprecated` is ignored on globals when assigned by another global
meta.lua
---@meta
--
--Assigning a global fails.
--
Global = {}
---@deprecated
AssignedGlobal = Global
--
--Assigning a field of a global also fails.
--
Global.field = {}
---@deprecated
AssignedGlobalField = Global.field
--
--Standard object works.
--
---@deprecated
Object = {}
--
--Assignment of local object works.
--
local alsoWorking = {}
---@deprecated
AssignedLocalObject = alsoWorking
test.lua
local x = AssignedGlobal
local y = AssignedGlobalField
local z = Object
local a = AssignedLocalObject
Interestingly the deprecation is shown correctly in the autocomplete: