[swift-evolution] Revisiting SE-0110
Gwendal Roué
gwendal.roue at gmail.com
Mon Jun 5 23:39:58 CDT 2017
Wait, there's more!
> When passing a closure with a single underscore argument ({ _ in ...}) to a function expecting multiple arguments, the compiler may error after migration with:
>
> error: cannot convert value of type '(_) -> ()' to expected argument
> type
> (32301091)
> Workaround: To fix the error, change the single argument to the correct number of arguments
>
> such as { (_,_) in ...}
>
>
>
> When passing a closure to map with two function arguments, the compiler may after migration error with:
>
> error: 'map' produces '[T]', not the expected contextual result type
> '<TYPE>'
> (32432752)
> Workaround: Change the closure signature to accept a tuple argument of two elements when
>
> using map.
>
Gwendal
> Le 6 juin 2017 à 06:36, Gwendal Roué <gwendal.roue at gmail.com> a écrit :
>
> http://adcdownload.apple.com/WWDC_2017/Xcode_9_beta/Xcode_9_beta_Release_Notes.pdf <http://adcdownload.apple.com/WWDC_2017/Xcode_9_beta/Xcode_9_beta_Release_Notes.pdf>
>
>> The migrator does not properly distinquish between single-tuple and multiple-argument function types as described in SE–0110, causing additional mismatched type errors with the closure types that are passed to Standard Library functions expecting tuple objects. (32431899)
>>
>> Workaround: Manually fix the closure types to accept values of tuples instead of separate argument values.
>>
>>
>>
>> When using $0 and $1 in a closure that is passed to a function expecting a closure with a single tuple argument, the compiler may error after migration with:
>>
>> error: closure tuple parameter '(TYPE, TYPE)' does not support
>> destructuring with implicit parameters
>> (32489893)
>>
>> Workaround: Change $0 and $1 references to $0.0 and $0.1 respectively.
>>
> Where are the firemen?
>
> Gwendal
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20170606/602c3635/attachment.html>
More information about the swift-evolution
mailing list