Skip to content

Commit f7d924a

Browse files
committed
Return Syntax, rather than SyntaxProtocol, from foldAll
1 parent 67769e0 commit f7d924a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Sources/SwiftOperators/OperatorTable+Folding.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ extension OperatorTable {
453453
public func foldAll<Node: SyntaxProtocol>(
454454
_ node: Node,
455455
errorHandler: OperatorErrorHandler = { throw $0 }
456-
) rethrows -> SyntaxProtocol {
456+
) rethrows -> Syntax {
457457
return try withoutActuallyEscaping(errorHandler) { errorHandler in
458458
let folder = SequenceFolder(
459459
opPrecedence: self, errorHandler: errorHandler

Sources/swift-parser-test/swift-parser-test.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ func foldAllSequences(_ tree: SourceFileSyntax) -> (Syntax, [Diagnostic]) {
7575
var operatorTable = OperatorTable.standardOperators
7676
operatorTable.addSourceFile(tree, errorHandler: recordOperatorError)
7777
let resultTree = operatorTable.foldAll(tree, errorHandler: recordOperatorError)
78-
return (Syntax(resultTree), diags)
78+
return (resultTree, diags)
7979
}
8080

8181
class VerifyRoundTrip: ParsableCommand {

0 commit comments

Comments
 (0)