Closed Nemo157 closed 4 years ago
@Nemo157 oh yeah, I've run into this at least once before. I'd be very :+1: on a patch (if you'd like to submit one). Though #73 is also working on this exact code right now, and maybe we could merge it into that patchset.
Using this example
the error message is
This is backwards to the error generated with a non-
async
main for the same codeThe current expansion is approximately
this runs into https://github.com/rust-lang/rust/issues/54326, as a workaround till that is fixed the expansion could be changed to something like
forcing an intermediate type check of the implicit return (this won't fix cases where the code does an early return of the wrong type, but it will fix the relatively common forgetting of
Ok(())
at the end of error returning functions).