The C# compiler generates a CS1998 warning when an async
method lacks any await
operators.
What are the reasons behind the warning?
I know that async
introduces overhead in the method by adding a statemachine and exception handling.
Is the primary reason for the warning performance?
Or is the reason to notify me that I might have forgotten an await
somewhere?
Maybe someone from the language design team can shed some light on this one... :)
(Please: do not post answers that say 'you can remove async
to make the warning go away'. I want to know the reasons and decisions behind the warning, not ways to work around it.)