# Default Isolation: MainActor vs. property wrappers

**URL:** <https://forums.swift.org/t/default-isolation-mainactor-vs-property-wrappers/80416>\
**Category:** Using Swift\
**Tags:** concurrency, mainactor\
**Created:** [June 11, 2025, 8:40pm UTC](https://forums.swift.org/t/default-isolation-mainactor-vs-property-wrappers/80416 "2025-06-11T20:40:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mikchmie](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/mikchmie/32/41206_2.png) [@mikchmie](https://forums.swift.org/u/mikchmie)\
**Post date:** [June 11, 2025, 8:40pm UTC](https://forums.swift.org/t/default-isolation-mainactor-vs-property-wrappers/80416/1 "2025-06-11T20:40:24Z")

</div>

I'm testing the new "Default (Actor) Isolation: MainActor" build setting introduced in Xcode 26 / Swift 6.2 and encountered an issue. I wanted to mark all my DTO types (which are modeled as Sendable structs) as nonisolated, so they can be used freely on any actor. In these types I'm using some property wrappers that simplify the Codable implementation — e.g. `LossyArray` which drops invalid objects during decoding — and there seems to be a problem with that.

```swift
nonisolated struct Foo: Decodable, Sendable {
    // Error: 'nonisolated' is not supported on properties with property wrappers
    @LossyArray var bar: [Bar]
}

```

(where `LossyArray` is nonisolated and Sendable as well)

Is this an expected behavior?

I understand that removing isolation for a single property in an isolated type might be tricky when a wrapper is involved. But in this case the entire type is nonisolated and I'm not trying to change that property's isolation. I would expect this code to work as if the "nonisolated" was used as a value for "Default Isolation" setting instead of being added as a modifier on this particular type.

---

<div class="post-metadata">

**Author:** ![simanerush](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/simanerush/32/30785_2.png) [@simanerush](https://forums.swift.org/u/simanerush)\
**Post date:** [June 11, 2025, 8:48pm UTC](https://forums.swift.org/t/default-isolation-mainactor-vs-property-wrappers/80416/2 "2025-06-11T20:48:18Z")

</div>

This is a bug, which is being fixed with this PR: [[Concurrency] Allow explicit 'nonisolated' on lazy properties and properties with property wrappers if they are a member of a non-'Sendable' type. by simanerush · Pull Request #79895 · swiftlang/swift · GitHub](https://github.com/swiftlang/swift/pull/79895)
