@@ -531,7 +531,7 @@ public struct AssertParseOptions: OptionSet {
531
531
/// parsing the resulting `String` as a ``SourceFileSyntax``.
532
532
func assertParse(
533
533
_ markedSource: String ,
534
- substructure expectedSubstructure: Syntax ? = nil ,
534
+ substructure expectedSubstructure: ( some SyntaxProtocol ) ? = Optional < Syntax > . none ,
535
535
substructureAfterMarker: String = " START " ,
536
536
diagnostics expectedDiagnostics: [ DiagnosticSpec ] = [ ] ,
537
537
applyFixIts: [ String ] ? = nil ,
@@ -609,7 +609,7 @@ fileprivate func assertRoundTrip<S: SyntaxProtocol>(
609
609
func assertParse< S: SyntaxProtocol > (
610
610
_ markedSource: String ,
611
611
_ parse: ( inout Parser ) -> S ,
612
- substructure expectedSubstructure: Syntax ? = nil ,
612
+ substructure expectedSubstructure: ( some SyntaxProtocol ) ? = Optional < Syntax > . none ,
613
613
substructureAfterMarker: String = " START " ,
614
614
diagnostics expectedDiagnostics: [ DiagnosticSpec ] = [ ] ,
615
615
applyFixIts: [ String ] ? = nil ,
@@ -648,11 +648,11 @@ func assertParse<S: SyntaxProtocol>(
648
648
649
649
// Substructure
650
650
if let expectedSubstructure {
651
- let subtreeMatcher = SubtreeMatcher ( Syntax ( tree) , markers: markerLocations)
651
+ let subtreeMatcher = SubtreeMatcher ( tree, markers: markerLocations)
652
652
do {
653
653
try subtreeMatcher. assertSameStructure (
654
654
afterMarker: substructureAfterMarker,
655
- Syntax ( expectedSubstructure) ,
655
+ expectedSubstructure,
656
656
includeTrivia: options. contains ( . substructureCheckTrivia) ,
657
657
file: file,
658
658
line: line
@@ -760,9 +760,9 @@ func assertBasicFormat<S: SyntaxProtocol>(
760
760
let formattedReparsed = Syntax ( parse ( & formattedParser) )
761
761
762
762
do {
763
- let subtreeMatcher = SubtreeMatcher ( Syntax ( formattedReparsed) , markers: [ : ] )
763
+ let subtreeMatcher = SubtreeMatcher ( formattedReparsed, markers: [ : ] )
764
764
try subtreeMatcher. assertSameStructure (
765
- Syntax ( sourceTree) ,
765
+ sourceTree,
766
766
includeTrivia: false ,
767
767
additionalInfo: """
768
768
Removing trivia, formatting using BasicFormat and re-parsing did not produce the same syntax tree.
0 commit comments