Class typed table annotation #1277
Answered
by
sumneko
Rouneq
asked this question in
General Questions
|
I've got a case where I'm creating a table with special key indexing rules (making it case insensitive). Since I'm developing under Luajit, I'm having to go through some hoops to iterate over the table. To complicate this further, I'm also sorting the keys to return them in alphabetical order. I decided to create a function on the table specifically to return this ordered iterator. That's all working fine. I'm wanting to better annotate the return so table is typed. When I use the following: the table type annotation is treated as comment. Am I missing something or is this currently unsupported? |
Answered by
sumneko
Jul 4, 2022
Replies: 1 comment
|
Use |
0 replies
Answer selected by
Rouneq
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Use
---@alias ICaseTable table<string, any>or---@class ICaseTable : { [string]: any }instead