@@ -531,7 +531,7 @@ public struct AssertParseOptions: OptionSet {
531531/// parsing the resulting `String` as a ``SourceFileSyntax``.
532532func assertParse(
533533 _ markedSource: String ,
534- substructure expectedSubstructure: Syntax ? = nil ,
534+ substructure expectedSubstructure: ( some SyntaxProtocol ) ? = Optional < Syntax > . none ,
535535 substructureAfterMarker: String = " START " ,
536536 diagnostics expectedDiagnostics: [ DiagnosticSpec ] = [ ] ,
537537 applyFixIts: [ String ] ? = nil ,
@@ -609,7 +609,7 @@ fileprivate func assertRoundTrip<S: SyntaxProtocol>(
609609func assertParse< S: SyntaxProtocol > (
610610 _ markedSource: String ,
611611 _ parse: ( inout Parser ) -> S ,
612- substructure expectedSubstructure: Syntax ? = nil ,
612+ substructure expectedSubstructure: ( some SyntaxProtocol ) ? = Optional < Syntax > . none ,
613613 substructureAfterMarker: String = " START " ,
614614 diagnostics expectedDiagnostics: [ DiagnosticSpec ] = [ ] ,
615615 applyFixIts: [ String ] ? = nil ,
@@ -648,11 +648,11 @@ func assertParse<S: SyntaxProtocol>(
648648
649649 // Substructure
650650 if let expectedSubstructure {
651- let subtreeMatcher = SubtreeMatcher ( Syntax ( tree) , markers: markerLocations)
651+ let subtreeMatcher = SubtreeMatcher ( tree, markers: markerLocations)
652652 do {
653653 try subtreeMatcher. assertSameStructure (
654654 afterMarker: substructureAfterMarker,
655- Syntax ( expectedSubstructure) ,
655+ expectedSubstructure,
656656 includeTrivia: options. contains ( . substructureCheckTrivia) ,
657657 file: file,
658658 line: line
@@ -760,9 +760,9 @@ func assertBasicFormat<S: SyntaxProtocol>(
760760 let formattedReparsed = Syntax ( parse ( & formattedParser) )
761761
762762 do {
763- let subtreeMatcher = SubtreeMatcher ( Syntax ( formattedReparsed) , markers: [ : ] )
763+ let subtreeMatcher = SubtreeMatcher ( formattedReparsed, markers: [ : ] )
764764 try subtreeMatcher. assertSameStructure (
765- Syntax ( sourceTree) ,
765+ sourceTree,
766766 includeTrivia: false ,
767767 additionalInfo: """
768768 Removing trivia, formatting using BasicFormat and re-parsing did not produce the same syntax tree.
0 commit comments