[swift-dev] prefix map ambiguous

Ben Cohen ben_cohen at apple.com
Thu Jan 11 22:30:33 CST 2018


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 at 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 at swift.org
> https://lists.swift.org/mailman/listinfo/swift-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-dev/attachments/20180111/63c3c516/attachment.html>


More information about the swift-dev mailing list