Skip to content

Fake enums should not be exposed as globals #76

Open
@TIMONz1535

Description

@TIMONz1535

https://wiki.facepunch.com/gmod/Enums/NavTraverseType
https://wiki.facepunch.com/gmod/Enums/NavDir
https://wiki.facepunch.com/gmod/Enums/NavCorner
https://wiki.facepunch.com/gmod/Enums/AMMO
https://wiki.facepunch.com/gmod/Enums/GOALTYPE
https://wiki.facepunch.com/gmod/Enums/TEXTUREFLAGS
https://wiki.facepunch.com/gmod/Enums/SNDLVL

There is no tag to determine that they are fake, it's just a custom warning.

These enums should not be exposed as globals, we can

  1. Remove globals from definition and leave only the main alias of enum with numbers, in case someone makes it as number{ENUM}.
---@alias NavDir 0 | 1 | 2 | 3
  1. Make it completely aliases
--- North from given [CNavArea](https://wiki.facepunch.com/gmod/CNavArea)
---@alias NORTH 0
--- East from given [CNavArea](https://wiki.facepunch.com/gmod/CNavArea)
---@alias EAST 1
--- South from given [CNavArea](https://wiki.facepunch.com/gmod/CNavArea)
---@alias SOUTH 2
--- West from given [CNavArea](https://wiki.facepunch.com/gmod/CNavArea)
---@alias WEST 3

---@alias NavDir
---| NORTH
---| EAST
---| SOUTH
---| WEST

but again the weird comments display
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions