Hi Kelvin,

Can you give a bit more detail on the type of the sequence, and which compiler 
version you’re seeing this on?

I can’t reproduce this with a recent Xcode or a recent master toolchain with 
this code:

let sequence = 0..<10
let n = 5
let f = { $0*2 }

sequence.prefix(n).map(f)

Thanks
Ben

> On Jan 11, 2018, at 19:11, Kelvin Ma via swift-dev <swift-dev@swift.org> 
> wrote:
> 
> when I write sequence.prefix(n).map(f) the compiler complains that .prefix is 
> ambiguous. If I replace it with [..<n] it works fine. Why is this happening? 
> I found SR-1856 <https://bugs.swift.org/browse/SR-1856> which looks like a 
> similar issue but it’s marked fixed.
> _______________________________________________
> swift-dev mailing list
> swift-dev@swift.org
> https://lists.swift.org/mailman/listinfo/swift-dev

_______________________________________________
swift-dev mailing list
swift-dev@swift.org
https://lists.swift.org/mailman/listinfo/swift-dev

Reply via email to