Skip to content

[Concurrency] Audit diagnostics for Swift 6. #71244

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Feb 1, 2024

Conversation

hborla
Copy link
Member

@hborla hborla commented Jan 30, 2024

This patch makes a few functional changes to strict concurrency diagnostics:

  • @preconcurrency warnings should only come back when the imported module has enabled Swift 6. Warnings when the client enables Swift 6 are not useful because that's not the point when the library API has been audited.
  • Sendable diagnostics are errors in Swift 6.

This change also adds a new .limitBehaviorUntilSwiftVersion API on InFlightDiagnostic and uses it for all concurrency diagnostics that are suppressed or downgraded until Swift 6. There are a few benefits to using a UntilSwiftVersion diagnostic engine API, including the diagnostic wrapping to communicate that the mistake will be an error in Swift 6, and to include the mistake in the frontend statistic for Swift 6 errors.

…he imported

module has enabled Swift 6.

Warnings when the client enables Swift 6 are not useful because that's not the
point when the library API has been audited.
@hborla hborla force-pushed the swift-6-diagnostics branch from 74c9c99 to 09432a9 Compare January 31, 2024 02:50
…` to

downgrade or suppress errors until a specified language version.
…iagnostics

that are suppressed or downgraded until Swift 6.

There are a few benefits to using a `UntilSwiftVersion` diagnostic engine API,
including the diagnostic wrapping to communicate that the mistake will be an
error in Swift 6, and to include the mistake in the frontend statistic for
Swift 6 errors.
@hborla hborla force-pushed the swift-6-diagnostics branch from 71be559 to 11cb94f Compare February 1, 2024 01:08
@hborla hborla requested a review from AnthonyLatsis as a code owner February 1, 2024 01:08
@hborla
Copy link
Member Author

hborla commented Feb 1, 2024

@swift-ci please smoke test

@hborla
Copy link
Member Author

hborla commented Feb 1, 2024

@swift-ci please smoke test Linux

@hborla hborla merged commit b37d436 into swiftlang:main Feb 1, 2024
@hborla hborla deleted the swift-6-diagnostics branch February 1, 2024 06:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant