[Pitch] Improved Compiler Support for Large Homogenous Tuples

Yes, that is a danger, but it isn’t specific to tuples. It would be just as much of an issue for any other spelling of a fixed-size array that stored its elements directly.

The reason Array/String don’t have this precise issue (e.g. for lazy wrappers) is because the storage is heap allocated with an independent lifetime that can extended by retaining it. That said, they do have a sort-of similar issue when it comes to slices - in that even a small slice retains the entire parent Array/String (see Strings in Swift 4 section “Substrings”).

1 Like