Slightly incorrect help message with mismatched typs in async code #66910
Labels
A-async-await
Area: Async & Await
A-diagnostics
Area: Messages for errors, warnings, and lints
AsyncAwait-Triaged
Async-await issues that have been triaged during a working group meeting.
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
The following works, since
foo
andbar
return()
, so the expression is simply returned:The "equivalent" code in the
async
context yields a compiler error:The help message would be correct for non-async-code with mismatched types, but in the async case a
.await
should be suggested.Technically the current help message is correct, but leads to another warning (that can be even overlooked):
So you have to do a second compile iteration.
I'd suggest to spawn a help message like that:
The text was updated successfully, but these errors were encountered: