File tree Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -1412,7 +1412,14 @@ extension Parser {
1412
1412
public mutating func parseFunctionSignature( ) -> RawFunctionSignatureSyntax {
1413
1413
let input = self . parseParameterClause ( for: . functionParameters)
1414
1414
1415
- let async = self . consumeIfContextualKeyword ( " async " )
1415
+ let async : RawTokenSyntax ?
1416
+ if let asyncTok = self . consumeIfContextualKeyword ( " async " ) {
1417
+ async = asyncTok
1418
+ } else if let reasync = self . consumeIfContextualKeyword ( " reasync " ) {
1419
+ async = reasync
1420
+ } else {
1421
+ async = nil
1422
+ }
1416
1423
1417
1424
var throwsKeyword = self . consume ( ifAny: [ . throwsKeyword, . rethrowsKeyword] )
1418
1425
Original file line number Diff line number Diff line change @@ -1005,6 +1005,21 @@ final class DeclarationTests: XCTestCase {
1005
1005
func isolatedConst(isolated _const: String) {}
1006
1006
"""# )
1007
1007
}
1008
+
1009
+ func testReasyncFunctions( ) throws {
1010
+ AssertParse (
1011
+ """
1012
+ class MyType {
1013
+ init(_ f: () async -> Void) reasync {
1014
+ await f()
1015
+ }
1016
+
1017
+ func foo(index: Int) reasync rethrows -> String {
1018
+ await f()
1019
+ }
1020
+ }
1021
+ """ )
1022
+ }
1008
1023
}
1009
1024
1010
1025
extension Parser . DeclAttributes {
You can’t perform that action at this time.
0 commit comments