Initializing an array from sequence or by repeating an element is not implemented

swift

(marc hoffman) #21

Right. same applies there. (Ranges will get Sequence support, I just gotta implement it).


(Marko Havu) #22

The following piece of code results in “Ambiguous method call”:

let array = [UInt16]([8, 0])

The potential overloads listed for constructor are:

func Swift.Array<UInt16!>..(_ list: NSArray<UInt16>)
func Swift.Array<UInt16!>..(_ sequence: RemObjects.Elements.System.INSFastEnumeration<UInt16>)

Is this related to the issues above, or is it completely separate?

I also tried the following:

let x1 = [UInt16](array: [8, 0])  // Results in: Parameter should be labeled "copy"
let x2 = [UInt16](sequence: [8, 0])  // This works

(marc hoffman) #23

probably, yeah. is this still Cocoa, though? then the (_ sequence overload should *not be valid for arrays, strange. I’ll bring this top for internal discussion what we can do here…


(Marko Havu) #25

Yes, still Cocoa


(RemObjects) #26

bugs://81651 got closed with status nochangereq.