# \[Prospective Vision\] Improving the approachability of data-race safety

**URL:** <https://forums.swift.org/t/prospective-vision-improving-the-approachability-of-data-race-safety/76183>\
**Category:** Pitches\
**Tags:** concurrency, visions\
**Created:** [November 23, 2024, 12:23am UTC](https://forums.swift.org/t/prospective-vision-improving-the-approachability-of-data-race-safety/76183 "2024-11-23T00:23:57Z")\
**Posts on this page:** 1\
**Showing post:** 136

<div class="post-metadata">

**Author:** ![cthielen](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/cthielen/32/32960_2.png) [@cthielen](https://forums.swift.org/u/cthielen)\
**Post date:** [November 30, 2024, 7:19am UTC](https://forums.swift.org/t/prospective-vision-improving-the-approachability-of-data-race-safety/76183/136 "2024-11-30T07:19:04Z")

</div>

Thank you for putting this together. I'm excited about a number of ideas being proposed.

> Nonetheless, we are tentatively very excited about the potential for this feature to fix problems with how Swift's generics system interacts with isolated types, especially global-actor-isolated types.

In [[Review] SF-0011: Concurrency-Safe Notifications](https://forums.swift.org/t/review-sf-0011-concurrency-safe-notifications/75975), we propose a protocol `Message` and another called `MainActorMessage`, the latter existing so that function overloads decorated with `@MainActor` are used for `Message` types that are effectively main actor-bound. It would be nice to not have `MainActorMessage` and instead have the generics system select an overload based on global actor conformance, e.g.:

```swift
// General overload
genericFunc<M: Message>(…)

// MainActor-overload
@MainActor genericFunc<M: Message & @MainActor>(…) // some kind of syntax expressing that the generic type has an isolation conformance requirement

```

---

_[View the full topic](https://forums.swift.org/t/prospective-vision-improving-the-approachability-of-data-race-safety/76183)._
