Generally, pattern binding in `if` looks like this:
if case *pattern* = *expression* { ... }
Pattern binding for optionals is currently usable as both of:
if case let .some(x) = y { ... }
if case let x? = y { ... }
Now, there is also an older optional-specific hack:
if let x = y { ... }
In terms of pattern binding, it should always be true, and it's illogical
inside `if`.
I suggest:
1) Remove optional pattern binding
2) Remove `case` in `if` pattern binding
Really, `case` should be an attribute of `switch`, not `if`.
Pattern binding for optionals will look like:
if let x? = y { ... }
It will become more explicit and consistent with the rest of the language.
We need to hurry until Swift 3 lands!
- Anton
_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution