# \[Returned for revision\] SE-0371: Isolated synchronous deinit

**URL:** <https://forums.swift.org/t/returned-for-revision-se-0371-isolated-synchronous-deinit/60060>\
**Category:** Announcements\
**Created:** [September 2, 2022, 3:39pm UTC](https://forums.swift.org/t/returned-for-revision-se-0371-isolated-synchronous-deinit/60060 "2022-09-02T15:39:55Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![tcldr](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/tcldr/32/24405_2.png) [@tcldr](https://forums.swift.org/u/tcldr)\
**Post date:** [November 3, 2023, 1:43pm UTC](https://forums.swift.org/t/returned-for-revision-se-0371-isolated-synchronous-deinit/60060/6 "2023-11-03T13:43:12Z")

</div>

Very pleased to see there's a potential solution to resolve this.

With Actors promoted as a way to 'protect shared mutable state', in practice that often means a wrapper for a bunch of non-Sendable conforming types. So, the requirement that members of an actor _must also_ be Sendable to be accessible in the deinit is rather non-intuitive.

> [@Jumhyn](#):
>
> However, there were some concerns around defaulting `deinit`s to being isolated

I think this is fair enough, but I have to say the asymmetry around isolation between a types `init`/`deinit` and its members is pretty confusing and seems inconsistent. The example given for actor initializers in the review shows that actor initializers are, by default, non-isolated, and therefore we should follow the same example for `deinit`.

> [@SE-0371: Isolated synchronous deinit](https://forums.swift.org/t/se-0371-isolated-synchronous-deinit/59754/3):
>
> We should not align `deinit` with methods, but with `init`, specifically:
> 
> ```swift
> actor A { 
> let x: Int
> 
> init() {
> self.x = 12
> // NO HOP, because not-`async` (!)
> // can't touch isolated properties; body is effectively nonisolated here
> }
> 
> init() async {
> self.x = 12
> // HOP, because `async` (!)
> doThings()
> }
> }
> 
> ```

And yet, for GAITs, it seems we _are_ isolated:

```swift

@MainActor class GAIT {
  
  let x: Int
  
  init(x: Int) {
    self.x = x
    doStuff() // No sweat.
  }
  
  func doStuff() {
    print("x: \(x)")
  }
}

```

So it seems by the logic of the review, we should at least default GAITs to have isolated `deinit`s.

More broadly though, I wish there was someway of getting consistency across these various types. It seems that the most intuitive solution would have been to require actors and GAITs to mark their `init`/`deinit`s with `nonisolated` if that was indeed the context they'd be called in – leaving the defaults to be isolated (or not available) – but perhaps that ship has now sailed.

---

_[View the full topic](https://forums.swift.org/t/returned-for-revision-se-0371-isolated-synchronous-deinit/60060)._
