enhance sema's remapping of pattern expressions into patterns to handle multiple

???'s stacked on top of each other in patterns.  This wraps up:
<rdar://problem/19382878> Introduce new x? pattern

please kick the tires and let me know if you see any problems.


Swift SVN r26002
This commit is contained in:
Chris Lattner
2015-03-11 23:23:32 +00:00
parent d88f3767c3
commit 6b31c2fa67
2 changed files with 28 additions and 5 deletions

View File

@@ -120,8 +120,23 @@ default:
break
}
// <rdar://problem/19382878> Introduce new x? pattern
switch Optional(42) {
case let x?: break
case nil: break
}
// Test x???? patterns.
switch (nil as Int???) {
case let x???: print(x)
case let x??: print(x)
case let x?: print(x)
case 4???: break
case nil??: break
case nil?: break
default: break
}