Avatar
Avatar
omochimetaru
@swift-6.0.3 @swift-6.1.3 @swift-6.2.3 -swift-version 6 final class Bar { init() {} } @MainActor class Foo { let value: Bar nonisolated init() { self.value = Bar() } }
exit status 1 with stderr:<stdin>:10:14: error: main actor-isolated property 'value' can not be mutated from a nonisolated context 5 | @MainActor 6 | class Foo { 7 | let value: Bar | `- note: mutation of this property is only permitted within the actor 8 | 9 | nonisolated init() { 10 | self.value = Bar() | `- error: main actor-isolated property 'value' can not be mutated from a nonisolated context 11 | } 12 | }