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:
Chris Lattner
2015-03-12 00:39:43 +00:00
parent 83541dd362
commit 5549775677
8 changed files with 59 additions and 27 deletions

View File

@@ -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