File tree Expand file tree Collapse file tree 4 files changed +32
-9
lines changed
Expand file tree Collapse file tree 4 files changed +32
-9
lines changed Original file line number Diff line number Diff line change @@ -131,13 +131,17 @@ extension GenericArgumentClauseSyntax: TypeSyntaxSupportingGenerics {
131131 newArgument = type. erasingGenericTypes ( genericTypes)
132132 default : continue
133133 }
134+ let newArgumentElement = GenericArgumentSyntax (
135+ argument: . type( newArgument) ,
136+ trailingComma: argumentElement. trailingComma
137+ )
134138 #else
135139 let newArgument : TypeSyntax = argumentElement. argument. erasingGenericTypes ( genericTypes)
140+ let newArgumentElement = GenericArgumentSyntax (
141+ argument: newArgument,
142+ trailingComma: argumentElement. trailingComma
143+ )
136144 #endif
137- let newArgumentElement = GenericArgumentSyntax (
138- argument: newArgument,
139- trailingComma: argumentElement. trailingComma
140- )
141145 newArgumentElements. append ( newArgumentElement)
142146 }
143147
Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ struct ClosureFactory {
4848 } ,
4949 effectSpecifiers: TypeEffectSpecifiersSyntax (
5050 asyncSpecifier: functionSignature. effectSpecifiers? . asyncSpecifier,
51- throwsSpecifier : functionSignature. effectSpecifiers? . throwsSpecifier
51+ throwsClause : functionSignature. effectSpecifiers? . throwsClause
5252 ) ,
5353 returnClause: returnClause
5454 )
@@ -166,7 +166,14 @@ struct ClosureFactory {
166166 expression = AwaitExprSyntax ( expression: expression)
167167 }
168168
169- if functionSignature. effectSpecifiers? . throwsSpecifier != nil {
169+
170+ #if canImport(SwiftSyntax600)
171+ let throwsSpecifier = functionSignature. effectSpecifiers? . throwsClause? . throwsSpecifier
172+ #else
173+ let throwsSpecifier = functionSignature. effectSpecifiers? . throwsSpecifier
174+ #endif
175+
176+ if throwsSpecifier != nil {
170177 expression = TryExprSyntax ( expression: expression)
171178 }
172179
@@ -189,7 +196,7 @@ struct ClosureFactory {
189196extension FunctionParameterListSyntax . Element {
190197 fileprivate var isInoutParameter : Bool {
191198 if let attributedType = self . type. as ( AttributedTypeSyntax . self) ,
192- attributedType. specifier ? . text == TokenSyntax . keyword ( . inout) . text
199+ attributedType. specifiers . first ? . firstToken ( viewMode : . all ) ? . text == TokenSyntax . keyword ( . inout) . text
193200 {
194201 return true
195202 } else {
Original file line number Diff line number Diff line change @@ -87,7 +87,13 @@ struct FunctionImplementationFactory {
8787 )
8888 }
8989
90- if protocolFunctionDeclaration. signature. effectSpecifiers? . throwsSpecifier != nil {
90+ #if canImport(SwiftSyntax600)
91+ let throwsSpecifier = protocolFunctionDeclaration. signature. effectSpecifiers? . throwsClause? . throwsSpecifier
92+ #else
93+ let throwsSpecifier = protocolFunctionDeclaration. signature. effectSpecifiers? . throwsSpecifier
94+ #endif
95+
96+ if throwsSpecifier != nil {
9197 throwableErrorFactory. throwErrorExpression ( variablePrefix: variablePrefix)
9298 }
9399
Original file line number Diff line number Diff line change @@ -157,8 +157,14 @@ struct SpyFactory {
157157 parameterList: parameterList
158158 )
159159 }
160+
161+ #if canImport(SwiftSyntax600)
162+ let throwsSpecifier = functionDeclaration. signature. effectSpecifiers? . throwsClause? . throwsSpecifier
163+ #else
164+ let throwsSpecifier = functionDeclaration. signature. effectSpecifiers? . throwsSpecifier
165+ #endif
160166
161- if functionDeclaration . signature . effectSpecifiers ? . throwsSpecifier != nil {
167+ if throwsSpecifier != nil {
162168 try throwableErrorFactory. variableDeclaration ( variablePrefix: variablePrefix)
163169 }
164170
You can’t perform that action at this time.
0 commit comments