You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But providing a number instead of a string in the brackets gives a syntax error.
In typescript you'd do
typeTuple=[number,string,boolean]
But that syntax doesn't exist in Luau either. Nor does (number, string, boolean), or {number, string, boolean} (which would be nearly ambiguous with arrays.)
This is partially a question - partially to see if I need to continue this with an RFC. It would be nice to use tuples for simpler types like Spans instead of needing full field names. And I don't think the implementation would be very difficult considering the precedent with the existing syntax for strings I demonstrated.
The text was updated successfully, but these errors were encountered:
I've looked everywhere and I cannot seem to find any indication that tuples, or typed numeric table indices, exist.
Usually when documentation here refers to tuples it's in reference to multiple return values, but I'm referring to
For Emmylua/LuaLS, you'd type this as
---@type { [1]: number, [2]: string, [3]: boolean }
Such syntax almost exists in Luau?
But providing a number instead of a string in the brackets gives a syntax error.
In typescript you'd do
But that syntax doesn't exist in Luau either. Nor does
(number, string, boolean)
, or{number, string, boolean}
(which would be nearly ambiguous with arrays.)This is partially a question - partially to see if I need to continue this with an RFC. It would be nice to use tuples for simpler types like
Span
s instead of needing full field names. And I don't think the implementation would be very difficult considering the precedent with the existing syntax for strings I demonstrated.The text was updated successfully, but these errors were encountered: