Skip to content

Commit e6de6bf

Browse files
authored
Merge pull request #1781 from kimdv/kimdv/fix-warnings
fix deprecation warnings and code generation
2 parents 06a19a4 + 0b4c20c commit e6de6bf

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Sources/SwiftRefactor/CallToTrailingClosures.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ extension FunctionCallExprSyntax {
9595
)
9696
}
9797

98-
var converted = self.detach()
98+
var converted = self.detached
9999

100100
// Remove parens if there's no non-closure arguments left and remove the
101101
// last comma otherwise. Makes sure to keep the trivia of any removed node.

Sources/SwiftRefactor/ExpandEditorPlaceholder.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,9 @@ extension FunctionTypeSyntax {
169169
/// ```
170170
fileprivate var closureExpansion: ClosureExprSyntax {
171171
let closureSignature: ClosureSignatureSyntax?
172-
if !arguments.isEmpty {
172+
if !parameters.isEmpty {
173173
let args = ClosureParamListSyntax {
174-
for arg in arguments {
174+
for arg in parameters {
175175
ClosureParamSyntax(name: arg.expansionNameToken())
176176
}
177177
}
@@ -261,13 +261,13 @@ extension FunctionCallExprSyntax {
261261
var parser = Parser(edit.replacement)
262262
let expr = ExprSyntax.parse(from: &parser)
263263
expandedArgs.append(
264-
arg.detach().with(\.expression, expr)
264+
arg.detached.with(\.expression, expr)
265265
)
266266
}
267267

268268
let originalArgs = argumentList.dropLast(argsToExpand)
269269
return (
270-
detach().with(\.argumentList, TupleExprElementListSyntax(originalArgs + expandedArgs)),
270+
detached.with(\.argumentList, TupleExprElementListSyntax(originalArgs + expandedArgs)),
271271
expandedArgs.count
272272
)
273273
}

0 commit comments

Comments
 (0)