Language: Records: type naming and nesting?

Created on 16 Nov 2020  路  1Comment  路  Source: dart-lang/language

After reading @munificent great spec document I have a question about if it will be possible to name record types (with typedefs?) and hence nest records.

What I have in mind is if I have a record to represent a Shoe, say ({String colour, int size}) can I use say a typedef to give this Record type a name,
eg.

typedef Shoe = ({String colour, int size})

so that then I can have say a Pair record like:
({Shoe left, Shoe right})
?
Or does the above not make sense for Records?

feature

Most helpful comment

Given that generalized type aliases (#65) is being actively worked on, it should be possible to name any type. I'd be surprised if that did not include tuple types.

>All comments

Given that generalized type aliases (#65) is being actively worked on, it should be possible to name any type. I'd be surprised if that did not include tuple types.

Was this page helpful?
0 / 5 - 0 ratings