≈ the.bay.news

Minor source break with `if let` and `guard let` bindings

Swift Forums
Minor source break with `if let` and `guard let` bindings
Just a heads up about something you might notice in upcoming developer snapshots. In Swift, if let and guard let bindings are intended to be used only with optional values. On the other hand, Swift also supports an implicit conversion of any type to an optional. These two together mean that in the case where you convert a value to an optional and immediately unwrap it, we need to emit a diagnostic, since that's probably not what you meant to do--the else branch is dead: func f() { if let x =...

0 comments

Sign in to join the discussion — your thebay.events account works here.

No comments yet.