Thanks to nonisolated(nonsending) functions, isolated parameters are much less-needed than ever. But, they still do come up, particularly when working with non-Sendable types. And my experience is that people, in general, find the syntax quite intimidating. But beyond that, it also sometimes feels like an internal detail of the system. I think nonisolated(nonsending) really highlights this, because in that case the parameter has actually been made an internal detail.
So now, I find myself wondering if that's something that could be useful to expand like this:
class NonSendable {
func explicitParam(actor: isolated any Actor) {
}
// hypothetical syntax
isolated func implicitParam() {
}
}
Now, on the one hand, I think that nonisolated(nonsending) has gone so far to help here, it could be this is mostly just not an issue worth spending more energy on. But then again, using isolated (any Actor)? with a non-Sendable is unsafe, and I find that pretty non-obvious (despite it just being a bug). That's a real pain, because then you cannot use #isolation to hide the bookkeeping at call-sites. And then there's the whole thing about how unusual the special parameter thing in the first place. These reasons alone feel fairly compelling to me.
It is true that you'd be giving up explicit control over the actor type. But my experience is that is very rarely required, and isn't possible with nonisolated(nonsending) functions anyways, so there's a nice symmetry here. I think this could be pretty much identical internally, including resolving the #isolation expression inside the function body.
So, the question. Is sugar like this worth it? I've gone back and forth on this topic a number of times, but I finally decided it could be worth getting other opinions.