<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Mar 8, 2017 at 5:09 AM, Haravikk via swift-evolution <span dir="ltr">&lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>willSet and didSet have their own distinct scope; they execute independently, however a switch statement is effectively a single scope because of the ability to use fallthrough to visit later cases.</div><div></div></blockquote></div><br>A switch statement has a separate scope for every case, including default. Example:</div><div class="gmail_extra"><br></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div class="gmail_extra"><div class="gmail_extra">switch Int() {</div></div><div class="gmail_extra"><div class="gmail_extra">case 0:</div></div><div class="gmail_extra"><div class="gmail_extra">    let m = &quot;zero&quot;</div></div><div class="gmail_extra"><div class="gmail_extra">    fallthrough</div></div><div class="gmail_extra"><div class="gmail_extra">default:</div></div><div class="gmail_extra"><div class="gmail_extra">    Swift.print(m)</div></div><div class="gmail_extra"><div class="gmail_extra">}</div></div></blockquote><div class="gmail_extra"><div class="gmail_extra"><br></div><div class="gmail_extra">Result:</div><div class="gmail_extra"><br></div></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div class="gmail_extra"><div class="gmail_extra"><div class="gmail_extra">Playground execution failed: error: MyPlayground.playground:2:17: error: use of unresolved identifier &#39;m&#39;</div></div></div><div class="gmail_extra"><div class="gmail_extra"><div class="gmail_extra">    Swift.print(m)</div></div></div></blockquote><div class="gmail_extra"><div class="gmail_extra"><div><br></div></div></div></div>