Skip to content

Conversation

@jmagman
Copy link
Member

@jmagman jmagman commented Jan 14, 2026

Enforce Swift 6 strict concurrency during testing to catch thread checker and other main actor errors and regressions as we migrate package tests to Swift 6 flutter/flutter#150388.

See https://www.swift.org/documentation/concurrency.

Follow-up from discussion here: #10762 (comment)

Note if you don't use @MainActor there will be a main thread checker error because the test won't run on the main thread:

Image
PointerInterceptorView.swift:12 UIView.initWithFrame: must be used from main thread only

Though the test still passed. I'm not sure how to make it an error instead of a warning, without converting the whole thing to a test plan (which seems overkill)

Confirmed in d7d4ea7#diff-2941dc3894ffd50d9031c12999cf0ec618d817525423934f46442f797a1b86fdL10 that forcing a main actor error does indeed fail the test:

Testing failed:
	Main actor-isolated property 'backgroundColor' can not be referenced from a nonisolated context
	Testing cancelled because the build failed.

Part of flutter/flutter#180755

Pre-Review Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the gemini-code-assist bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.

Footnotes

  1. Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. 2 3

@jmagman jmagman changed the title [ci] Enforce Swift strict concurrency during testing [ci] Enforce Swift 6 strict concurrency during testing Jan 15, 2026
@jmagman
Copy link
Member Author

jmagman commented Jan 15, 2026

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