# SE-0371: Isolated synchronous deinit

**URL:** <https://forums.swift.org/t/se-0371-isolated-synchronous-deinit/59754>\
**Category:** Proposal Reviews\
**Tags:** concurrency\
**Created:** [August 18, 2022, 11:14pm UTC](https://forums.swift.org/t/se-0371-isolated-synchronous-deinit/59754 "2022-08-18T23:14:09Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![inamiy](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/inamiy/32/45098_2.png) [@inamiy](https://forums.swift.org/u/inamiy)\
**Post date:** [August 28, 2022, 7:10am UTC](https://forums.swift.org/t/se-0371-isolated-synchronous-deinit/59754/8 "2022-08-28T07:10:17Z")

</div>

+0.5 at the moment.

Previously I wrote in the pitch:

> [@Isolated synchronous deinit](https://forums.swift.org/t/isolated-synchronous-deinit/58177/7):
>
> +1 for opt-in deinit async as I previously commented in: And in my opinion: "Non-isolated deinit when code is not written" will mislead developers when they just want to write a debug-print to observe when actor instance actually gets deallocated. // Assume this is implicit isolated deinit. deinit { // This printing may be called slower than non-isolated deinit. // (Also, thread printing will get changed which might also be tricky) print("deinit in \(Thread.current)") }

and added a concern about "nonisolated deinit" (when not writing deinit explicitly) which then suddenly turns into "isolated deinit" when writing.  
I think this will cause a huge behavioral gap without any available opt-ins.

While "deinit async" came up as a solution for opt-in explicit isolated deinit, I now find that the entire discussion could be simplified just by introducing **`nonisolated deinit`** keyword instead to opt-in the same behavior as the compiler implicitly injects.

I believe having `nonisolated deinit` will eventually avoid thinking about complicated `deinit async` topic, and `nonisolated deinit` (or `deinit async` in the 2nd favor) is also a must-have feature to accompany with this proposal to add extra +0.5.

### Side note

As a side note, having `nonisolated deinit` will unfortunately break:

- `init` / `init async` / `deinit` / `deinit async`

symmetry, but I'm recently inclined to look for:

- `nonisolated init` / `init` / `nonisolated deinit` / `deinit`

as more simpler and better correspondence, which actually oppose to the already-accepted [SE-0327 On Actors and Initialization](https://github.com/apple/swift-evolution/blob/main/proposals/0327-actor-initializers.md).

While explaining why is another long topic (so I will skip here for now), we can still discuss about `nonisolated deinit` separately from initializer (and their symmetry) topic.

---

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