Swift: multidimensional array initialisation

Originator:sangonz
Number:rdar://17561681 Date Originated:4/7/2014
Status:Open Resolved:
Product:Developer Tools Product Version:Xcode 6.0 (6A215I)
Classification: Reproducible:Yes
 
Summary:
The way of initialising multidimensional arrays to a fixed value in Swift is ridiculously hard to read.

Expected Results:
This would be OK:
var array = Double[][](count: [5,3], repeatedValue: 1.0)

But this would be awesome:
var array = Double[5][3](1.0)

Actual Results:
var foo = Double[][](count: 5, repeatedValue:Double[](count: 3, repeatedValue:2.0));

Comments

Even better!

var array: Double[5][3] = 1.0;


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!