rspec/rules/S3168/csharp/comments-and-links.adoc

22 lines
1.0 KiB
Plaintext
Raw Normal View History

=== On 2015-06-30T13:36:13Z Ann Campbell Wrote:
\[~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?
=== On 2015-07-01T07:10:48Z Tamas Vajk Wrote:
\[~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)
=== On 2015-07-01T11:31:53Z Ann Campbell Wrote:
\[~tamas.vajk] that makes me wonder if we should generalize this rule to catch _any_ ``++async++`` method that does not return a ``++Task++``...?
=== On 2015-07-01T11:49:54Z Tamas Vajk Wrote:
\[~ann.campbell.2] That's a compiler error (CS1983, _The return type of async must be void, Task or Task<T>_).
=== On 2015-07-01T11:59:39Z Ann Campbell Wrote:
Okay, thanks [~tamas.vajk]