`if let` shorthand

My thoughts on this remain similar to what I had to say last May:

Since I haven't seen it otherwise mentioned in this thread, I'll also resurface what I think is important precedent in the language for having special language support for the "initialize a new binding that shadows an existing binding with the same name". We already allow this for closure capture lists:

So we aren't inventing an entirely new concept here.

As for if let x { vs. if let x? {: as noted above, I think if let already serves as a pretty strong indicator to Swift programmers that there's an optional unwrap happening, but the signal may not be as strong for, say, if var (or future if inout, if ref) unwrapping shorthand. So perhaps that's a case for requiring the trailing question mark, though also maybe those uses won't be common enough to justify 'muddying' the overwhelmingly common if let case. I think I have a weak preference for if let x? but could very likely be happy with either in the language.

8 Likes