So the proposal is to change the compiler's handling of void in "return e" from this (pseudocode):
if ( typeof(e) == void ) { compile(evaluate side effects of e); warn("Returning a void expression. Converted to zero."); compile(return 0); }
to this:
if ( typeof(e) == void ) { compile(evaluate side effects of e); if ( return_type(this_function) == void ) { compile(return); } else { warn("Returning a void expression. Converted to zero."); compile(return 0); } }
? Seems reasonable to me.