File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Sources/SwiftParserDiagnostics Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -630,7 +630,9 @@ public class ParseDiagnosticsGenerator: SyntaxAnyVisitor {
630
630
message: { _ in . typeParameterPackEllipsis }
631
631
)
632
632
} else if let unexpected = node. unexpectedBetweenNameAndColon,
633
- let unexpectedEllipsis = unexpected. onlyToken ( where: { $0. tokenKind == . ellipsis } ) {
633
+ let unexpectedEllipsis = unexpected. onlyToken ( where: { $0. tokenKind == . ellipsis } ) ,
634
+ let each = node. each
635
+ {
634
636
addDiagnostic (
635
637
unexpected,
636
638
. typeParameterPackEllipsis,
@@ -639,11 +641,11 @@ public class ParseDiagnosticsGenerator: SyntaxAnyVisitor {
639
641
message: ReplaceTokensFixIt ( replaceTokens: [ unexpectedEllipsis] , replacement: . keyword( . each) ) ,
640
642
changes: [
641
643
. makeMissing( unexpected) ,
642
- . makePresent( node . each! , trailingTrivia: . space)
644
+ . makePresent( each, trailingTrivia: . space) ,
643
645
]
644
646
)
645
647
] ,
646
- handledNodes: [ unexpected. id, node . each! . id]
648
+ handledNodes: [ unexpected. id, each . id]
647
649
)
648
650
}
649
651
if let inheritedTypeName = node. inheritedType? . as ( SimpleTypeIdentifierSyntax . self) ? . name {
You can’t perform that action at this time.
0 commit comments