lua-language-server icon indicating copy to clipboard operation
lua-language-server copied to clipboard

`@deprecated` is ignored on globals when assigned by another global

Open rhys-vdw opened this issue 8 months ago • 2 comments

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

Image

Interestingly the deprecation is shown correctly in the autocomplete:

Image

rhys-vdw avatar Feb 13 '25 15:02 rhys-vdw