<div dir="ltr">Ah no, it's just that they at one time had support for taking away `case` and doing `if let b? = a`. See the commit notes that Chris linked to here: <a href="https://github.com/apple/swift/commit/20f8f09ea8de5eb1c0cb559e59c8a8e8a0e115a9#diff-4513b692cdd5476630ebb66b73d5bf4b">https://github.com/apple/swift/commit/20f8f09ea8de5eb1c0cb559e59c8a8e8a0e115a9#diff-4513b692cdd5476630ebb66b73d5bf4b</a>.<div><br></div><div>I guess the current `if let b = a` syntax is what John was referring to as special syntactic support, but I still don't see why the `?` was taken out of the syntax.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Dec 6, 2015 at 3:43 PM, Alex Lew <span dir="ltr"><<a href="mailto:alexl.mail+swift@gmail.com" target="_blank">alexl.mail+swift@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>let a: Int? = 3</div><div>if case let b? = a {</div><div> print(b)</div><div>}</div><div><br></div><div>works for me in Swift 2.2. Have they announced that they're taking this away?</div><div><br></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Sun, Dec 6, 2015 at 4:38 PM, Tyler Mandry via swift-evolution <span dir="ltr"><<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr">
What isn't clear to me from Chris's or John's comments is why the `if let x? = foo` syntax was taken away. Was it for backward-compatibility? To me, this syntax does have special syntactic support, and also seems to make it clearer what's going on. It's also analogous to Swift's type inference for generic <T?> types, for example:
<div>
<br>
</div>
<div>
func doSomething<T? where T: Equatable>(x: T?) -> T { ... }
</div>
<div>
<div>
<br>
</div>
<div>
Note the T? in brackets. If I pass an Int? to doSomething, the type is "unwrapped" and T becomes Int. It seems like `if let x? = foo` would follow the same pattern.
</div>
<div>
<br>
</div>
<div>
Was the syntax taken away for reasons unlikely to change, or is it up for discussion? :)
</div><span><font color="#888888">
<div>
<br>
</div>--
<br>
<div>
Tyler Mandry
</div>
</font></span></div><span><font color="#888888">
</font></span></div><span><font color="#888888">
<div style="margin-top:10px;font-size:12px;font-family:Helvetica,Arial;color:#999"><br></div></font></span><br></div></div>_______________________________________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
<br></blockquote></div><br></div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Tyler Mandry</div>
</div>