File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed
Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -1375,7 +1375,7 @@ extension Parser {
13751375 var effectSpecifiers = self . parseDeclEffectSpecifiers ( )
13761376
13771377 let output : RawReturnClauseSyntax ?
1378- if self . at ( . arrow) {
1378+ if let _ = self . canRecoverTo ( TokenSpec ( . arrow) ) {
13791379 output = self . parseFunctionReturnClause ( effectSpecifiers: & effectSpecifiers, allowNamedOpaqueResultType: true )
13801380 } else {
13811381 output = nil
Original file line number Diff line number Diff line change @@ -98,7 +98,7 @@ extension Parser {
9898 /// This function is used when parsing places where function bodies are
9999 /// optional - like the function requirements in protocol declarations.
100100 mutating func parseOptionalCodeBlock( allowInitDecl: Bool = true ) -> RawCodeBlockSyntax ? {
101- guard self . at ( . leftBrace) else {
101+ guard let _ = self . canRecoverTo ( TokenSpec ( . leftBrace) ) else {
102102 return nil
103103 }
104104 return self . parseCodeBlock ( allowInitDecl: allowInitDecl)
You can’t perform that action at this time.
0 commit comments