mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[ASTGen] Handle 'try' at the first element of SequenceExprSyntax
TryExpr must be hosted to wrap the whole sequence expression.
This commit is contained in:
@@ -85,6 +85,11 @@ func testUnaryExprs() async throws {
|
||||
let bar = copy foo
|
||||
let baz = consume foo
|
||||
}
|
||||
func throwsFunc() throws -> Int { 1 }
|
||||
func testOptionalTry() {
|
||||
let _ = try! 1 + throwsFunc()
|
||||
let _ = try? throwsFunc() + throwsFunc()
|
||||
}
|
||||
|
||||
func testRepeatEach<each T>(_ t: repeat each T) -> (repeat each T) {
|
||||
return (repeat each t)
|
||||
|
||||
Reference in New Issue
Block a user