Silencing Swift 6 concurrency warnings in Swift 5 mode

I'm working on migrating our codebase to be Xcode 16 compatible. At my company we have warnings as errors enabled, and for now we are in Swift 5 mode as we are not yet ready to adopt concurrency (we're working on it).

It seems Xcode 16 will warn you about concurrency errors even in Swift 5 mode. At the moment, they are only getting in our way. We want to get onto Xcode 16 and handle concurrency separately, but it seems Xcode 16 wants to force us to handle those two (both rather monumental) tasks at the same time.

Is there a way to disable these warnings?

1 Like

Does the discussion in this thread seem relevant? I.e., does @preconcurrency import help you, or are you in one of the buggy cases where @preconcurrency introduces a warning (which should be fixed)?

1 Like

I still get the warning in this case, unless Xcode is just bugged and the warning didn't go away from before I annotated the import:

If you can, consider making lastActionDateSortDescriptor a computed property. That way there’s no shared state, and it can be safely accessed from any isolation domain, even if NSSortDescriptor is not Sendable.

1 Like

I don't love the idea of making something computed just to satisfy memory safety warnings :/ especially when I don't want to opt into said warnings to begin with

The warnings that you posted a screenshot of upthread are gated behind complete concurrency checking. This could be a manifestation of Swift 6 language mode being passed to dependencies which is fixed by [6.0][Concurrency] Don't attempt to diagnose `GlobalConcurrency` issues wi… by xedin · Pull Request #74624 · swiftlang/swift · GitHub.

3 Likes

I see, thank you for the context! Do you know which beta will that change be in?

1 Like

@hborla I'm still seeing such warnings in beta 6, was this really fixed?