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

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