# \[Actors\] Revisiting "nonisolated let" with more implementation, usage, and teaching experience

**URL:** <https://forums.swift.org/t/actors-revisiting-nonisolated-let-with-more-implementation-usage-and-teaching-experience/47972>\
**Category:** Pitches\
**Created:** [May 7, 2021, 9:45pm UTC](https://forums.swift.org/t/actors-revisiting-nonisolated-let-with-more-implementation-usage-and-teaching-experience/47972 "2021-05-07T21:45:12Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Zhu\_Shengqi](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/zhu_shengqi/32/1199_2.png) [@Zhu\_Shengqi](https://forums.swift.org/u/Zhu_Shengqi)\
**Post date:** [May 8, 2021, 1:56am UTC](https://forums.swift.org/t/actors-revisiting-nonisolated-let-with-more-implementation-usage-and-teaching-experience/47972/3 "2021-05-08T01:56:44Z")

</div>

The issue raised here is very critical, but I suggest we first have SE-0313 ([SE-0313: Improved control over actor isolation](https://forums.swift.org/t/se-0313-improved-control-over-actor-isolation/47813)) finalized and accepted, then we can look back at how to solve the synchronous accessing of `nonisolated let` issue.

The main reason is that currently we have two approaches towards actor isolation:

- Using `nonisolated let` as value-directed way (which is described in the main body of SE-0313).
- Using `@sync MyActor` and `@async MyActor` as a type-directed way (which is mentioned in the **alternatives considered** section of SE-0313, see [Exploration: Type System Considerations for Actor Proposal](https://forums.swift.org/t/exploration-type-system-considerations-for-actor-proposal/44540)).

While I have replied in SE-0313 that we should discuss more about the pros and cons of these two approaches, I find it quite easy to solve the problem raised in this proposal with the type-directed way (`@sync MyActor` and `@async MyActor`):

This is the free function that mentioned in this proposal

> [@Douglas\_Gregor](#):
>
> ```swift
> func displayAccount(account: BankAccount) {
> print("Account #\(account.accountNumber) owned by \(account.owners.joined(separator: ", "))")
> }
> 
> ```

Which is equivalent to the following definition using type-directed way:

```swift
func displayAccount(account: @sync BankAccount) {
 // Same synchronous accessing to BackAccount actors
}

```

So with the type-directed approach, no matter how we change between the `let` and `var` for property declarations, we can always access these from an actor, as long as it is a `@sync BackAccount`.

Actually the issue raised in this proposal convinced me that the type-directed approach (`@sync MyActor` and `@async MyActor`) is a better way to solve those issues related to actor isolation, because we use the type system to handle the cases in a uniformed way instead of creating complex syntax rules just for fixing holes.

---

_[View the full topic](https://forums.swift.org/t/actors-revisiting-nonisolated-let-with-more-implementation-usage-and-teaching-experience/47972)._
