Skip to content

How to overload indexing? #2442

Closed Answered by firas-assaad
loganmcbroom asked this question in Q&A
Discussion options

You must be logged in to vote

By index operator, do you mean something like this?

---@class Class
---@field bool boolean
---@field [string] integer
---@field [integer] string
local class

local bool = class.bool
local int = class.string
local str = class[3]

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by loganmcbroom
Comment options

You must be logged in to vote
0 replies
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