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 {
1375
1375
var effectSpecifiers = self . parseDeclEffectSpecifiers ( )
1376
1376
1377
1377
let output : RawReturnClauseSyntax ?
1378
- if self . at ( . arrow) {
1378
+ if let _ = self . canRecoverTo ( TokenSpec ( . arrow) ) {
1379
1379
output = self . parseFunctionReturnClause ( effectSpecifiers: & effectSpecifiers, allowNamedOpaqueResultType: true )
1380
1380
} else {
1381
1381
output = nil
Original file line number Diff line number Diff line change @@ -98,7 +98,7 @@ extension Parser {
98
98
/// This function is used when parsing places where function bodies are
99
99
/// optional - like the function requirements in protocol declarations.
100
100
mutating func parseOptionalCodeBlock( allowInitDecl: Bool = true ) -> RawCodeBlockSyntax ? {
101
- guard self . at ( . leftBrace) else {
101
+ guard let _ = self . canRecoverTo ( TokenSpec ( . leftBrace) ) else {
102
102
return nil
103
103
}
104
104
return self . parseCodeBlock ( allowInitDecl: allowInitDecl)
You can’t perform that action at this time.
0 commit comments