-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Open
Labels
rule-requestRequests for a new rules.Requests for a new rules.
Description
New Issue Checklist
- I've Updated SwiftLint to the latest version.
- I've searched for existing GitHub issues.
Feature or Enhancement Proposal
There are a number of ways to break compatibility with Swift 5 mode (strict concurrency off) that are difficult to notice. Here are some examples:
@MainActor
public class MainThreadOnly {}
public func takeBlock(_ block: @Sendable () - Void)
public func takeGlobalBlock(_ block: @MainActor () - Void)
In all of these cases, to preserve compatibility you must use @preconcurrency
.
@preconcurrency @MainActor
public class MainThreadOnly {}
@preconcurrency
public func takeBlock(_ block: @Sendable () - Void)
@preconcurrency
public func takeGlobalBlock(_ block: @MainActor () - Void)
I think this could be a great new rule!
Metadata
Metadata
Assignees
Labels
rule-requestRequests for a new rules.Requests for a new rules.