<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Wait, there's more!<div class="">
                
        
        
                <div class="page" title="Page 28">
                        <div class="section" style="background-color: rgb(100.000000%, 100.000000%, 100.000000%)">
                                <div class="layoutArea">
                                        <div class="column"><p class=""></p><blockquote type="cite" class=""><p class=""><span style="font-size: 11.000000pt; font-family: 'SFHello'" class="">When passing a closure with a single underscore argument (</span><span style="font-size: 10.000000pt; font-family: 'SFMono'; color: rgb(49.803920%, 49.803920%, 49.803920%)" class="">{ _ in ...}</span><span style="font-size: 11.000000pt; font-family: 'SFHello'" class="">) to a function expecting
multiple arguments, the compiler may error after migration with:
</span></p>
                                                <pre class=""><span style="font-size: 10.000000pt; font-family: 'SFMono'; color: rgb(49.803920%, 49.803920%, 49.803920%)" class="">    error: cannot convert value of type '(_) -&gt; ()' to expected argument
    type
</span></pre><p class=""><span style="font-size: 11.000000pt; font-family: 'SFHello'" class="">(32301091)<br class="">
</span><span style="font-size: 11.000000pt; font-family: 'SFHello'; font-weight: 700" class="">Workaround</span><span style="font-size: 11.000000pt; font-family: 'SFHello'" class="">: To fix the error, change the single argument to the correct number of arguments
</span></p><p class=""><span style="font-size: 11.000000pt; font-family: 'SFHello'" class="">such as </span><span style="font-size: 10.000000pt; font-family: 'SFMono'; color: rgb(49.803920%, 49.803920%, 49.803920%)" class="">{ (_,_) in ...}</span></p><p class=""><span style="font-size: 10.000000pt; font-family: 'SFMono'; color: rgb(49.803920%, 49.803920%, 49.803920%)" class=""><br class=""></span></p>
                
        
        
                <p class=""><span style="font-size: 11pt; font-family: SFHello;" class="">When passing a closure to </span><span style="font-size: 10pt; font-family: SFMono; color: rgb(127, 127, 127);" class="">map </span><span style="font-size: 11pt; font-family: SFHello;" class="">with two function arguments, the compiler may after migration
error with:</span></p>
                
        
        
                <div class="page" title="Page 29">
                        <div class="section">
                                <div class="layoutArea">
                                        <div class="column">
                                                <pre class=""><span style="font-size: 10.000000pt; font-family: 'SFMono'; color: rgb(49.803920%, 49.803920%, 49.803920%)" class="">       error: 'map' produces '[T]', not the expected contextual result type
       '&lt;TYPE&gt;'
</span></pre><p class=""><span style="font-size: 11.000000pt; font-family: 'SFHello'" class="">(32432752)<br class="">
</span><span style="font-size: 11.000000pt; font-family: 'SFHello'; font-weight: 700" class="">Workaround</span><span style="font-size: 11.000000pt; font-family: 'SFHello'" class="">: Change the closure signature to accept a tuple argument of two elements when
</span></p>
                                        </div>
                                </div>
                        </div>
                </div><p class=""><span style="font-size: 11pt; font-family: SFHello;" class="">using </span><span style="font-size: 10pt; font-family: SFMono; color: rgb(127, 127, 127);" class="">map</span><span style="font-size: 11pt; font-family: SFHello;" class="">.</span><span style="font-size: 10.000000pt; font-family: 'SFMono'; color: rgb(49.803920%, 49.803920%, 49.803920%)" class="">&nbsp;</span></p></blockquote></div></div></div></div></div><div class="">Gwendal</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">Le 6 juin 2017 à 06:36, Gwendal Roué &lt;<a href="mailto:gwendal.roue@gmail.com" class="">gwendal.roue@gmail.com</a>&gt; a écrit :</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">
                
        
        
                <div class="page" title="Page 27">
                        <div class="section" style="background-color: rgb(100.000000%, 100.000000%, 100.000000%)">
                                <div class="layoutArea">
                                        <div class="column"><p class=""><font face="SFHello" class=""><span style="font-size: 14.666666984558105px;" class=""><a href="http://adcdownload.apple.com/WWDC_2017/Xcode_9_beta/Xcode_9_beta_Release_Notes.pdf" class="">http://adcdownload.apple.com/WWDC_2017/Xcode_9_beta/Xcode_9_beta_Release_Notes.pdf</a></span></font></p><div class=""><br class="webkit-block-placeholder"></div></div></div></div></div></div><blockquote type="cite" class=""><div class=""><div class="page" title="Page 27"><div class="section" style="background-color: rgb(100.000000%, 100.000000%, 100.000000%)"><div class="layoutArea"><div class="column"><p class=""><span style="font-size: 11.000000pt; font-family: 'SFHello'" class="">The migrator does not properly distinquish between single-tuple and multiple-argument
function types as described in </span><span style="font-size: 11.000000pt; font-family: 'SFHello'; color: rgb(10.980390%, 47.843140%, 75.686270%)" class="">SE–0110</span><span style="font-size: 11.000000pt; font-family: 'SFHello'" class="">, causing additional mismatched type errors with the
closure types that are passed to Standard Library functions expecting tuple objects.
(32431899)
</span></p><p class=""><span style="font-size: 11.000000pt; font-family: 'SFHello'; font-weight: 700" class="">Workaround</span><span style="font-size: 11.000000pt; font-family: 'SFHello'" class="">: Manually fix the closure types to accept values of tuples instead of separate
argument values.</span></p><p class=""><span style="font-size: 11.000000pt; font-family: 'SFHello'" class=""><br class=""></span></p>
                
        
        
                <div class="page" title="Page 28">
                        <div class="section">
                                <div class="layoutArea">
                                        <div class="column"><p class=""><span style="font-size: 11.000000pt; font-family: 'SFHello'" class="">When using </span><span style="font-size: 10.000000pt; font-family: 'SFMono'; color: rgb(49.803920%, 49.803920%, 49.803920%)" class="">$0 </span><span style="font-size: 11.000000pt; font-family: 'SFHello'" class="">and </span><span style="font-size: 10.000000pt; font-family: 'SFMono'; color: rgb(49.803920%, 49.803920%, 49.803920%)" class="">$1 </span><span style="font-size: 11.000000pt; font-family: 'SFHello'" class="">in a closure that is passed to a function expecting a closure with a single
tuple argument, the compiler may error after migration with:
</span></p>
                                                <pre class=""><span style="font-size: 10.000000pt; font-family: 'SFMono'; color: rgb(49.803920%, 49.803920%, 49.803920%)" class="">    error: closure tuple parameter '(TYPE, TYPE)' does not support
    destructuring with implicit parameters
</span></pre><p class=""><span style="font-size: 11.000000pt; font-family: 'SFHello'" class="">(32489893)<br class=""></span></p>
                                        </div>
                                </div>
                        </div>
                </div><p class=""><span style="font-size: 11pt; font-family: SFHello; font-weight: 700;" class="">Workaround</span><span style="font-size: 11pt; font-family: SFHello;" class="">: Change </span><span style="font-size: 10pt; font-family: SFMono; color: rgb(127, 127, 127);" class="">$0 </span><span style="font-size: 11pt; font-family: SFHello;" class="">and </span><span style="font-size: 10pt; font-family: SFMono; color: rgb(127, 127, 127);" class="">$1 </span><span style="font-size: 11pt; font-family: SFHello;" class="">references to </span><span style="font-size: 10pt; font-family: SFMono; color: rgb(127, 127, 127);" class="">$0.0 </span><span style="font-size: 11pt; font-family: SFHello;" class="">and </span><span style="font-size: 10pt; font-family: SFMono; color: rgb(127, 127, 127);" class="">$0.1 </span><span style="font-size: 11pt; font-family: SFHello;" class="">respectively.</span><span style="font-size: 11.000000pt; font-family: 'SFHello'" class="">&nbsp;</span></p>
                                        </div>
                                </div>
                        </div>
                </div></div></blockquote><div class="">Where are the firemen?</div><div class=""><br class=""></div><div class="">Gwendal</div><div class=""><br class=""></div></div></div></blockquote></div><br class=""></div></body></html>