Skip to content

Commit 1c17c41

Browse files
committed
Return Syntax, rather than SyntaxProtocol, from foldAll
1 parent 280bf24 commit 1c17c41

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
@@ -67,7 +67,7 @@ func foldAllSequences(_ tree: SourceFileSyntax) -> (Syntax, [Diagnostic]) {
6767
var operatorTable = OperatorTable.standardOperators
6868
operatorTable.addSourceFile(tree, errorHandler: recordOperatorError)
6969
let resultTree = operatorTable.foldAll(tree, errorHandler: recordOperatorError)
70-
return (Syntax(resultTree), diags)
70+
return (resultTree, diags)
7171
}
7272

7373
class VerifyRoundTrip: ParsableCommand {

0 commit comments

Comments
 (0)