It's pretty similar to Sendable checking hole when actors call non-mutating async methods on non-Sendable types · Issue #65315 · swiftlang/swift · GitHub, which was marked fixed a long time ago. That bug also references How can self be accessible in a non-isolated async function of a non-Sendable type? · Issue #71097 · swiftlang/swift · GitHub, also marked closed, but I don't actually believe @hborla 's comment on this one — the async
on the mutating
method means there's always an actor hop to call it. And an async
method on a non-Sendable
class (as per OP here) is essentially the same problem.
FWIW, Holly has a proposal to change this default behavior of hopping actor at async
: [Pitch] Inherit isolation by default for async functions which would actually resolve this issue, but obviously that can't take effect before Swift 7, so this should be fixed now for Swift 6...