<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi Kelvin,<div class=""><br class=""></div><div class="">Can you give a bit more detail on the type of the sequence, and which compiler version you’re seeing this on?</div><div class=""><br class=""></div><div class="">I can’t reproduce this with a recent Xcode or a recent master toolchain with this code:</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><div style="margin: 0px; font-stretch: normal; font-size: 12px; line-height: normal;" class=""><span style="color: #0433ff" class="">let</span> sequence = 0..&lt;10</div><div style="margin: 0px; font-stretch: normal; font-size: 12px; line-height: normal;" class=""><span style="color: #0433ff" class="">let</span> n = 5</div><div style="margin: 0px; font-stretch: normal; font-size: 12px; line-height: normal;" class=""><span style="color: #0433ff" class="">let</span> f = { $0*2 }</div><div style="margin: 0px; font-stretch: normal; font-size: 12px; line-height: normal; font-family: Helvetica; min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; font-stretch: normal; font-size: 12px; line-height: normal; color: rgb(52, 149, 175);" class="">sequence<span style="color: #000000" class="">.</span>prefix<span style="color: #000000" class="">(</span>n<span style="color: #000000" class="">).</span><span style="text-decoration: underline" class="">m</span>ap<span style="text-decoration: underline ; color: #000000" class="">(</span><span style="text-decoration: underline" class="">f</span><span style="text-decoration: underline ; color: #000000" class="">)</span></div><div class=""><span style="text-decoration: underline ; color: #000000" class=""><br class=""></span></div><div class=""><span style="font-family: Helvetica; font-size: 12px;" class="">Thanks</span></div><div class=""><span style="font-family: Helvetica; font-size: 12px;" class="">Ben</span></div></div><div><br class=""><blockquote type="cite" class=""><div class="">On Jan 11, 2018, at 19:11, Kelvin Ma via swift-dev &lt;<a href="mailto:swift-dev@swift.org" class="">swift-dev@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">when I write <span style="font-family:monospace,monospace" class="">sequence.prefix(n).map(f)</span> the compiler complains that <span style="font-family:monospace,monospace" class="">.prefix</span> is ambiguous. If I replace it with <span style="font-family:monospace,monospace" class="">[..&lt;n]</span> it works fine. Why is this happening? I found <a href="https://bugs.swift.org/browse/SR-1856" class="">SR-1856</a> which looks like a similar issue but it’s marked fixed.<br class=""></div>
_______________________________________________<br class="">swift-dev mailing list<br class=""><a href="mailto:swift-dev@swift.org" class="">swift-dev@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-dev<br class=""></div></blockquote></div><br class=""></div></body></html>