Swift Generator for Zip2 of Array of tuples doesn't return both sides

Originator:christian.tietze
Number:rdar://21096510 Date Originated:2015-05-25
Status:Closed Resolved:
Product:Developer Tools Product Version:
Classification: Reproducible:Always
 
Summary:
When using the generator of Zip2, you expect e tuple for both elements in the first and second array.

It turns out that the generator wrongly returns a tuple of twice the same element from one array only. This is the case if the arrays contain tuples themselves:

for (left, right) in zip(anArrayOfTuples, anotherArrayOfTuples) {
// left == right
}

Steps to Reproduce:
- Create two arrays of tuples
- zip() both arrays together
- use for-in with to iterate the resulting Zip2 object
- compare both elements of the resulting tuple

Expected Results:
for (left, right) in zip(anArrayOfTuples, anotherArrayOfTuples) {
// left != right
}

Actual Results:
for (left, right) in zip(anArrayOfTuples, anotherArrayOfTuples) {
// left == right
}

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!