mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
enhance silgen to treat OptionalSomePattern and EnumElementPattern as
"similar", avoiding false positive "not exhaustive" diagnostics on switches
like:
switch ... {
case let x?: break
case .None: break
}
Also, start using x? patterns in the stdlib more (review appreciated!), which
is what shook this issue out.
Swift SVN r26004
This commit is contained in:
@@ -170,7 +170,7 @@ extension String {
|
||||
if _baseSet {
|
||||
if _ascii {
|
||||
switch self._asciiBase.next() {
|
||||
case let .Some(x):
|
||||
case let x?:
|
||||
result = .Result(UnicodeScalar(x))
|
||||
case .None:
|
||||
result = .EmptyInput
|
||||
|
||||
Reference in New Issue
Block a user