[Proposal] Implicit return Task.CompletedTask #7496
Replies: 2 comments 3 replies
-
Today this is completely legal if Additionally, I would hesitate to encourage fake-async implementations by a dedicated syntax, even though sometimes you are forced to this, eg. when you have to implement async interface methods without any actual async operation. |
Beta Was this translation helpful? Give feedback.
1 reply
-
Done: public async Task LogAsync(ILogMessage message) => Log(message); |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
For methods that...
Task
await
modifierTask.CompletedTask
...a
Task.CompletedTask
is implicitly returned.For example this...
...could be this with implicit
return Task.CompleteTask;
And futher shortened to:
Beta Was this translation helpful? Give feedback.
All reactions