Skip to content

@deprecated is ignored on globals when assigned by another global #3074

@rhys-vdw

Description

@rhys-vdw

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions