actor FooActor {
var x = 0
nonisolated func incrementEventually() {
Task { [isolated self] in
self.x += 1
}
}
}
But apparently [isolated self] isn't a valid capture.
I don't have a pressing need for this, I was just exploring this as one option for a potential problem, so this is more out of curiosity than anything else.
There was a pitch to enable things like [isolated self], but it hasn't seen any progress in the last few months. I believe that for now, you'd need to pull self.x += 1 out into a separate isolated function.