Post #1839178
2026-04-07 09:43 UTC
@akbashev @rhysmorgan you are right that a type like this can used from any isolation, including none at all. But the compiler will prevent unsafe accesses. So if the serialization that MainActor provides is necessary anywhere, you’ll know because it will fail to build.
Replies (1)
-
@rhysmorgan@mastodon.social 2026-04-07 11:13
@mattiem @akbashev Here's an example of just that, where the fact the test isn't isolated to any particular actor *is* a problem. (Also, the lack of a serial executor is a problem for this test's reliability, but that's something else to contend with). Isolating this specific test to an actor (any actor, not necessarily MainActor) allows it to compile, run, and (most of the time) pass.