I think I had something like this in my RFC under Implicitly binding coroutine arguments. One relatively small drawback is that it'd be harder to write a macro that wraps
yield and needs to use the passed-in value(s).
BTW, here are some other ideas I've had for dealing with
let (arg,) = yield:
1. Implement Deref/DerefMut on 1-tuples. You'd then write
let arg = yield, and the
arg would be a tuple, but auto-deref would allow you to use it in place of the inner value like 90% of the time. The rest of the time, you'd have to use
2. Alter type inference such that 1-tuple containing type T is allowed to unify with T and insert automatic tupling/un-tupling if that happens (a more transparent version of #1, basically). I am not sure about the overall impact of this on type inference, however.
let (arg1, arg2, arg3) = yield doesn't bother me nearly as much as the single-argument case.