void run() {
...
if (done) return cancel();
...
}
where cancel()
return void
. This won\'t compile... and I ca
Interesting idea. The main issue is the language spec, which defines a return statement as being composed of return
. A void method is not an expression, so the construct isn't permitted.
You've found that you can replicate the functionality by executing the void method and then returning, so there's no real reason to allow it.