[swift-evolution] Proposal: Contiguous Variables (A.K.A. Fixed Sized Array Type)

Joe Groff jgroff at apple.com
Fri Jan 29 11:25:45 CST 2016


> On Jan 28, 2016, at 9:41 PM, FĂ©lix Cloutier <felixcca at yahoo.ca> wrote:
> 
> I think that (4 x Int) needs to be syntax sugar for (Int, Int, Int, Int). Not having them the same would introduce awkward cases into the language.

Yes, they should be different spellings of the same type.
> 
> Because of that, I also think that forcing people to use the subscript would have some awkward consequences. What if I have a func<T, U> that uses a (T, U) tuple and both T and U happen to be the same type?

Statically we have to assume that's a heterogenous tuple. Indexing would either produce Any or be disallowed, depending on the design.

-Joe



More information about the swift-evolution mailing list