2021-06-03 09:05:38 +02:00
=== on 30 Jun 2015, 13:36:13 Ann Campbell wrote:
2021-06-02 20:44:38 +02:00
\[~tamas.vajk] I don't understand the code snippets. The ``++async Task++`` method doesn't return anything.
Also, could you morph the Noncompliant Example into a Compliant Solution, please?
2021-06-03 09:05:38 +02:00
=== on 1 Jul 2015, 07:10:48 Tamas Vajk wrote:
2021-06-02 20:44:38 +02:00
\[~ann.campbell.2] I added the compliant solution.
A method with ``++async++`` keyword returning a ``++Task++`` is like a non ``++async++`` method with ``++void++`` return type. Similarly in an ``++async Task<int>++`` method we can return a simple ``++int++``. (\https://msdn.microsoft.com/en-us/library/hh524395.aspx)
2021-06-03 09:05:38 +02:00
=== on 1 Jul 2015, 11:31:53 Ann Campbell wrote:
2021-06-02 20:44:38 +02:00
\[~tamas.vajk] that makes me wonder if we should generalize this rule to catch _any_ ``++async++`` method that does not return a ``++Task++``...?
2021-06-03 09:05:38 +02:00
=== on 1 Jul 2015, 11:49:54 Tamas Vajk wrote:
2021-06-02 20:44:38 +02:00
\[~ann.campbell.2] That's a compiler error (CS1983, _The return type of async must be void, Task or Task<T>_).
2021-06-03 09:05:38 +02:00
=== on 1 Jul 2015, 11:59:39 Ann Campbell wrote:
2021-06-02 20:44:38 +02:00
Okay, thanks [~tamas.vajk]