Skip to content

[6.2] [Observation] Create nonisolated conformances to Observable #81250

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

Conversation

DougGregor
Copy link
Member

@DougGregor DougGregor commented May 2, 2025

  • Explanation: The Observable macro generates a conformance that's meant to be nonisolated. When default-main-actor mode is enabled, the conformance ended up being @MainActor, causing errors in its use. Add nonisolated to the generated Observable conformance to avoid this problem
  • Scope: Limited to the Observable macro.
  • Issues: rdar://150419628
  • Original PRs: [Observation] Create nonisolated conformances to Observable #81249
  • Risk: Low. Provides
  • Testing: CI
  • Reviewers: @hborla

This is needed to make default-main-actor mode work well with
Observable. Fixes rdar://150419628.
@DougGregor DougGregor requested a review from a team as a code owner May 2, 2025 05:03
@DougGregor
Copy link
Member Author

@swift-ci please test

@DougGregor
Copy link
Member Author

@swift-ci please test Linux

@DougGregor
Copy link
Member Author

@swift-ci please test macOS

@DougGregor DougGregor merged commit 431aeca into swiftlang:release/6.2 May 5, 2025
5 checks passed
@DougGregor DougGregor deleted the observation-nonisolated-conformances-6.2 branch May 5, 2025 17:19
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.

2 participants