[swift-evolution] [RFD] Non-Self Protocol Requirements

Vladimir.S svabox at gmail.com
Mon May 16 11:09:13 CDT 2016


On 16.05.2016 18:06, Patrick Smith via swift-evolution wrote:
> let foo: [Double] = Double[int32, int8, double, cgfloat, float] // As if
> you had written Double(…) around each item

I really like this suggestion. Actually IMO we don't need explicit type 
declaration here:

// clearly it is an array of Double
let foo = Double[int32, int8, double, cgfloat, float]

We can use the same feature for other types like
let foo = String[1, 1.0, true]

Or even some complex type:
let foo = ComplexType[1, 1.0, true]

But I really don't like this:
//let foo: [Double] = [int32, int8, double, cgfloat, float](Double.init)


More information about the swift-evolution mailing list