Skip to content

Commit 63e2664

Browse files
committed
Return Syntax, rather than SyntaxProtocol, from foldAll
1 parent 10a42b7 commit 63e2664

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
@@ -62,7 +62,7 @@ func foldAllSequences(_ tree: SourceFileSyntax) -> (Syntax, [Diagnostic]) {
6262
var operatorTable = OperatorTable.standardOperators
6363
operatorTable.addSourceFile(tree, errorHandler: recordOperatorError)
6464
let resultTree = operatorTable.foldAll(tree, errorHandler: recordOperatorError)
65-
return (Syntax(resultTree), diags)
65+
return (resultTree, diags)
6666
}
6767

6868
class VerifyRoundTrip: ParsableCommand {

0 commit comments

Comments
 (0)