[swift-evolution] guard let x = x

Chris Lattner clattner at apple.com
Wed Oct 26 12:39:03 CDT 2016


> On Oct 26, 2016, at 10:23 AM, Joshua Alvarado <alvaradojoshua0 at gmail.com> wrote:
> 
> In your example the keyword only makes sense if you are shadowing the optional variable. How would unwrap work with a different name?

It wouldn’t: “unwrap” would never include an equal sign.  If you want to do that, use a standard "if let”.

-Chris



More information about the swift-evolution mailing list