Chaining Array.+ compiles very slowly

Originator:robnapier
Number:rdar://21842206 Date Originated:15-Jul-2015 05:12 PM
Status:Open Resolved:
Product:Developer Tools Product Version:Swift 2 beta 3
Classification:Other Bug Reproducible:Not Applicable
 
Chaining + to create an Array rapidly leads to very slow compile times. For example, this compiles very quickly (~1s in a playground)

var y = [1]
y += [2]
y += [3]
y += [4]

This compiles very slowly (several seconds in a playground):

let x = [1] + [2] + [3] + [4]

Adding another + increases the time dramatically.

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!