Skip to content

Commit 1378fac

Browse files
committed
Remove checking for sending
1 parent 9194070 commit 1378fac

File tree

2 files changed

+3
-27
lines changed

2 files changed

+3
-27
lines changed

Source/SwiftLintBuiltInRules/Rules/Lint/IncompatibleConcurrencyAnnotationRule.swift

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import SwiftSyntaxBuilder
44

55
@SwiftSyntaxRule(explicitRewriter: true, optIn: true)
66
struct IncompatibleConcurrencyAnnotationRule: Rule {
7-
var configuration = IncompatibleConcurrencyConfiguration()
7+
var configuration = IncompatibleConcurrencyAnnotationConfiguration()
88

99
static let description = RuleDescription(
1010
identifier: "incompatible_concurrency_annotation",
@@ -125,7 +125,7 @@ private func preconcurrencyRequired(for syntax: some WithModifiersSyntax & WithA
125125
if required { return true }
126126
}
127127

128-
// Check parameters for `@Sendable`, `sending` and global actors.
128+
// Check parameters for `@Sendable` and global actors.
129129
let parameterClause = syntax.as(FunctionDeclSyntax.self)?.signature.parameterClause
130130
?? syntax.as(InitializerDeclSyntax.self)?.signature.parameterClause
131131
?? syntax.as(SubscriptDeclSyntax.self)?.parameterClause
@@ -135,7 +135,7 @@ private func preconcurrencyRequired(for syntax: some WithModifiersSyntax & WithA
135135
if required { return true }
136136
}
137137

138-
// Check return types for `@Sendable`, `sending` and global actors.
138+
// Check return types for `@Sendable` and global actors.
139139
let returnType = syntax.as(FunctionDeclSyntax.self)?.signature.returnClause?.type
140140
?? syntax.as(SubscriptDeclSyntax.self)?.returnClause.type
141141
if let returnType {
@@ -197,8 +197,5 @@ private final class SendableTypeVisitor: SyntaxVisitor {
197197
}
198198
return false
199199
}
200-
found = found || node.specifiers.contains {
201-
$0.as(SimpleTypeSpecifierSyntax.self)?.specifier.text == "sending"
202-
}
203200
}
204201
}

Source/SwiftLintBuiltInRules/Rules/Lint/IncompatibleConcurrencyAnnotationRuleExamples.swift

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,6 @@ struct IncompatibleConcurrencyAnnotationRuleExamples {
8686
Example("public struct S { public ↓func sendableClosure(_ block: @Sendable () -> Void) }"),
8787
Example("public ↓init(_ block: @Sendable () -> Void)"),
8888
Example("public ↓init(param: @MainActor () -> Void)"),
89-
Example("public ↓func sendingParameter(_ value: sending MyClass)"),
90-
Example("public ↓func closureWithSendingArgument(_ handler: (_ value: sending MyClass) -> Void)"),
9189
Example("""
9290
public ↓func tupleParameter(
9391
_ handlers: (@Sendable () -> Void, @MainActor () -> Void)
@@ -110,7 +108,6 @@ struct IncompatibleConcurrencyAnnotationRuleExamples {
110108
Example("public ↓func returnsSendableClosure() -> @Sendable () -> Void"),
111109
Example("public ↓func returnsActorClosure() -> @MainActor () -> Void"),
112110
Example("public ↓func returnsClosureTuple() -> (@Sendable () -> Void, @MainActor () -> Void)"),
113-
Example("public ↓func returnsClosureWithSendingArgument() -> (_ value: sending MyClass) -> Void"),
114111

115112
// Custom global actors with configuration
116113
Example(
@@ -206,18 +203,6 @@ struct IncompatibleConcurrencyAnnotationRuleExamples {
206203
public func globalActorClosure(_ block: @MainActor () -> Void) {}
207204
"""),
208205

209-
Example("public func sendingParameter(_ value: sending MyClass) {}"):
210-
Example("""
211-
@preconcurrency
212-
public func sendingParameter(_ value: sending MyClass) {}
213-
"""),
214-
215-
Example("public func closureWithSendingArgument(_ handler: (_ value: sending MyClass) -> Void) {}"):
216-
Example("""
217-
@preconcurrency
218-
public func closureWithSendingArgument(_ handler: (_ value: sending MyClass) -> Void) {}
219-
"""),
220-
221206
Example("public func tupleParameter(_ handlers: (@Sendable () -> Void, @MainActor () -> Void)) {}"):
222207
Example("""
223208
@preconcurrency
@@ -280,12 +265,6 @@ struct IncompatibleConcurrencyAnnotationRuleExamples {
280265
public func returnsClosureTuple() -> (@Sendable () -> Void, @MainActor () -> Void) {}
281266
"""),
282267

283-
Example("public func returnsClosureWithSendingArgument() -> (_ value: sending MyClass) -> Void {}"):
284-
Example("""
285-
@preconcurrency
286-
public func returnsClosureWithSendingArgument() -> (_ value: sending MyClass) -> Void {}
287-
"""),
288-
289268
// Custom global actors with configuration
290269
Example(
291270
"@MyActor public struct S {}",

0 commit comments

Comments
 (0)