mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[SourceKit/CodeFormat] Column-align multiple patterns in catch clauses.
Catch clauses now support mutliple patterns. Like 'case' patterns, these
should be column-aligned if split across multiple lines.
do {
...
} catch MyErr.a(let x),
MyErr.b(let x) {
print("hello")
}
This commit is contained in:
@@ -939,3 +939,36 @@ IncrementedFirst++
|
||||
}++
|
||||
.baz()
|
||||
|
||||
|
||||
// Multiple patterns in catch should align exactly.
|
||||
|
||||
do {
|
||||
print("hello")
|
||||
} catch MyErr.a(let code, let message),
|
||||
MyErr.b(
|
||||
let code,
|
||||
let message
|
||||
),
|
||||
MyErr.c(let code, let message) {
|
||||
print("ahhh!")
|
||||
}
|
||||
|
||||
do {
|
||||
throw MyErr.a
|
||||
} catch where foo == 0,
|
||||
where bar == 1 {
|
||||
}
|
||||
|
||||
do
|
||||
{
|
||||
print("hello")
|
||||
}
|
||||
catch MyErr.a(let code, let message),
|
||||
MyErr.b(
|
||||
let code,
|
||||
let message
|
||||
),
|
||||
MyErr.c(let code, let message)
|
||||
{
|
||||
print("ahhh!")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user