Generic Array in for loop #2307
-
Hello does anyone know how I can get a generic array ---@class ProDS.Language
---@field public key string
---@class ProDS.LanguageArray<T>: { [integer]: T }
---@operator call:fun():string
---@type ProDS.LanguageArray<ProDS.Language>
local ab = {}
---This works fine
local test= ab[1]
---return nil but for the loop i need the __call operator
local fCallReturn = ab()
for cLanguage in cCatalog:Languages() do
print(cLanguage.key)
end so that everything fits |
Beta Was this translation helpful? Give feedback.
Answered by
carsakiller
Sep 6, 2023
Replies: 1 comment 1 reply
-
This would require generic classes, which are not supported yet. |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
Sedas25
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
This would require generic classes, which are not supported yet.