<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div><br></div><div>Le 1 nov. 2016 à 14:42, Erica Sadun via swift-evolution <<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>> a écrit :<br><br></div><blockquote type="cite">With massive revisions. I've added Xiaodi Wu to author list. I've combined all unwrapping together. I've added a much more sensible approach (plus a bluesky one) for real world enumerations.<div class=""><br class=""></div><div class="">Gist with live updates here: <a href="https://gist.github.com/erica/db9ce92b3d23cb20799460f603c0ae7c" class="">https://gist.github.com/erica/db9ce92b3d23cb20799460f603c0ae7c</a></div><div class=""><br class=""></div><div class="">Send feedback, I will continue to revise.</div><div class=""><br></div></blockquote><br><div><div><span style="background-color: rgba(255, 255, 255, 0);">The proposal should describe the behaviour with nested-optional and with enum case providing optionals.</span></div><div><span style="background-color: rgba(255, 255, 255, 0);"><br></span></div><div><span style="background-color: rgba(255, 255, 255, 0);">let x:Int?? = 42</span></div><div><span style="background-color: rgba(255, 255, 255, 0);">guard let y = x, let z = y else { return }</span></div><div><span style="background-color: rgba(255, 255, 255, 0);">// no final shadowing form currently exist for double unwrap</span></div><div><span style="background-color: rgba(255, 255, 255, 0);"><br></span></div><div><span style="background-color: rgba(255, 255, 255, 0);">enum sample { case data(Int?) }</span></div><div><span style="background-color: rgba(255, 255, 255, 0);">let x = sample.data(42)</span></div><div><span style="background-color: rgba(255, 255, 255, 0);">guard case .data(let x) = x, let y = x else { return }</span></div><div><span style="background-color: rgba(255, 255, 255, 0);">// x shadowed x, but still optional, cannot currently unwrap that optional as shadowing x</span></div><div><span style="background-color: rgba(255, 255, 255, 0);"><br></span></div><div><span style="background-color: rgba(255, 255, 255, 0);">Not sure if the design should fully handle these cases, but their behaviour should be shown as to how they interact with the proposed syntax.</span></div><div><div><span style="background-color: rgba(255, 255, 255, 0);"><br></span></div><div><span style="background-color: rgba(255, 255, 255, 0);">Regards</span></div><div><span style="background-color: rgba(255, 255, 255, 0);">Dany</span></div></div></div></body></html>