The compiler actually interprets T1
as a tuple with fields named string
and age
both of type int
and T2
as a tuple with fields named char
, string
, and age
of type int
. In short, the standalone "types" in the comma-separated list are interpreted as field names.
This is likely a compiler bug (as you can't use the field names for constructors) in that it doesn't validate the field names. But it's not that you have to provide a type for the last element only: the type will apply to all the elements in the comma-separated list preceding the colon.