[SR-10614] Assigning arrays of tuples to arrays of similar tuples surprisingly allocates. #53014
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler in itself
performance
standard library
Area: Standard library umbrella
Additional Detail from JIRA
md5: cc552939b1fbd98ddc37640577572edd
Issue Description:
The following code, when run, allocates 200,000 transient
_ContiguousArrayStorage
objects:The allocation stack is
The issue appears to be that the cast from
[(String, String)]
to[(name: String, value: String)]
triggers an allocation and copy, despite the fact that the two types are sufficiently close to identical that the compiler will simply let you assign one to the other.Either this should not allocate, or it should not be possible to assign the array of one type to a variable of the other.
The text was updated successfully, but these errors were encountered: