# SE-0470: Global-actor isolated conformances

**URL:** <https://forums.swift.org/t/se-0470-global-actor-isolated-conformances/78704>\
**Category:** Proposal Reviews\
**Created:** [March 21, 2025, 4:56am UTC](https://forums.swift.org/t/se-0470-global-actor-isolated-conformances/78704 "2025-03-21T04:56:58Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![Nickolas\_Pohilets](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/nickolas_pohilets/32/10659_2.png) [@Nickolas\_Pohilets](https://forums.swift.org/u/Nickolas_Pohilets)\
**Post date:** [March 23, 2025, 9:01am UTC](https://forums.swift.org/t/se-0470-global-actor-isolated-conformances/78704/6 "2025-03-23T09:01:00Z")

</div>

I've found a problem with down casting, but it is not specific to global-actor isolated conformances, but rather a general problem with marker protocols:

Normally it is not possible to cast to `Sendable`:

```swift
print(x as? Sendable) // error: marker protocol 'Sendable' cannot be used in a conditional cast

```

But if you ask nicely, it becomes possible:

```swift
func castPlease<T>(_ x: Any, to: T.Type) -> T? {
  return x as? T
}

protocol P {
  func foo() 
}

@MainActor
class MA: @MainActor P {
    func foo() {}
}

class NS {}

@MainActor
func test() {
  print(ObjectIdentifier((any P).self))
  print(ObjectIdentifier((any P & Sendable).self))
  print(castPlease(MA(), to: (any P & Sendable).self))
  print(ObjectIdentifier(Any.self))
  print(ObjectIdentifier((any Sendable).self))
  print(castPlease(NS(), to: (any Sendable).self))
}

// Prints:
// ObjectIdentifier(0x000000010456d340)
// ObjectIdentifier(0x000000010456d340)
// Optional(foo.MA)
// ObjectIdentifier(0x0000000104529de0)
// ObjectIdentifier(0x0000000104529de0)
// Optional(foo.NS)

```

Since metatypes with and without `Sendable` look the same in the runtime, this cannot be solved within the scope of the global-actor isolated conformances. I guess this could be solved by introducing another marker protocol (e.g. `Castable`), but that is out of scope of this feature.

---

_[View the full topic](https://forums.swift.org/t/se-0470-global-actor-isolated-conformances/78704)._
