mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
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:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user