Skip to content

Is there support for possible values for fields? #1658

Closed Answered by carsakiller
sebwr asked this question in Q&A
Discussion options

You must be logged in to vote

Hello!

Yes, it is supported. The issue you are having is due to specifying public for the field. By default, they are treated as public. Doing the following works for me:

---@alias spawnOptions
--- | '"room"'
--- | '"chest"'
--- | '"origin"'

---@class item
---@field spawnsin spawnOptions Where the item should spawn
local item = {}

The syntax you are using is not yet supported, but is being added for v3.6.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@sebwr
Comment options

Answer selected by sebwr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants