<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div><br></div><div>Le 14 avr. 2016 à 11:28, Антон Жилин via swift-evolution <<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>> a écrit :<br><br></div><blockquote type="cite"><div dir="ltr">As promised, I've created a proposal to add @shadowing attribute. Link to the proposal:<div><br><div><a href="https://github.com/Anton3/swift-evolution/blob/shadowing-imported-functions/proposals/NNNN-shadowing-imported-functions.md">https://github.com/Anton3/swift-evolution/blob/shadowing-imported-functions/proposals/NNNN-shadowing-imported-functions.md</a><br></div><div><br></div><div>Example:</div></div><div><br></div><div><pre style="overflow:auto;font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;margin-top:0px;margin-bottom:0px;font-stretch:normal;line-height:1.45;padding:16px;border-radius:3px;word-wrap:normal;color:rgb(51,51,51);background-color:rgb(247,247,247)"><span class="" style="color:rgb(150,152,150)">// Imported function (implicit declaration)</span>
<span class="" style="color:rgb(167,29,93)">func</span> <span class="" style="color:rgb(121,93,163)">dispatch_sync</span>(queue: dispatch_queue_t, block: (<span class="" style="color:rgb(167,29,93)">@convention</span>(block) () <span class="" style="color:rgb(167,29,93)">-></span> <span class="" style="color:rgb(0,134,179)">Void</span>)!)
<span class="" style="color:rgb(167,29,93)">@shadowing</span>(dispatch_sync(queue, block))
<span class="" style="color:rgb(167,29,93)">func</span> <span class="" style="color:rgb(121,93,163)">sync</span>(queue: dispatch_queue_t, <span class="" style="color:rgb(167,29,93)">@noescape</span> block: <span class="" style="color:rgb(167,29,93)">@convention</span>(block) () <span class="" style="color:rgb(167,29,93)">-></span> <span class="" style="color:rgb(0,134,179)">Void</span>)</pre></div><div><br></div></div></blockquote><br><div>It is unclear to me, if you plan to allow re-labelling, during the shadowing process.</div><div><br></div><div>Could the:</div><div> dispatch_sync(_,block:)</div><div>Be shadowed as either (if one disregard the API Guideline)</div><div> sync(_,block:)</div><div> sync(list:,task:)</div><div> sync(_,_)</div><div><br></div><div>If the import got the function name wrong, and missed the annotations like @noescape; it may also mislabel the parameters.</div><div><br></div><div>Dany</div><div><br></div></body></html>