mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +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:
@@ -151,7 +151,7 @@ public func split<S: Sliceable, R:BooleanType>(
|
||||
}
|
||||
|
||||
switch startIndex {
|
||||
case .Some(var i):
|
||||
case let i?:
|
||||
result.append(elements[i..<elements.endIndex])
|
||||
default:
|
||||
()
|
||||
@@ -408,10 +408,7 @@ public func lexicographicalCompare<
|
||||
}
|
||||
return false
|
||||
}
|
||||
switch e2_ {
|
||||
case .Some(_): return true
|
||||
case .None: return false
|
||||
}
|
||||
return e2_ != nil
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user