title: Tell the caller that a `async Task<T>` method may return null
body: <p>My situation is similar to the one described <a href="https://stackoverflow.com/questions/60891504/proper-nullable-annotation-for-async-generic-method-that-may-return-defaultt">Proper nullable annotation for async generic method that may return default(T)</a>.</p>
  <p>However, I'd like to know the proper way to let the caller know that the &quot;return value&quot; might be null.</p>
  <pre><code>    public async Task&lt;T&gt; GetAsync&lt;T&gt;()
      {
          // sometimes returns default(T)!;
      }
  </code></pre>
  <p>If this was not an async method I could use the MaybeNull attribute.</p>
  <pre><code>    [return: MaybeNull]
      public T Get&lt;T&gt;()
      {
          // sometimes returns default(T)!;
      }
  </code></pre>
  <p>If it was not generic I could just use the <code>?</code> syntax.</p>
  <pre><code>    public async Task&lt;string?&gt; GetAsync()
      {
          // sometimes returns default(string)!;
      }
  </code></pre>
  <p>Is there a way to let the caller know that it could be null without adding a generic constraint?</p>
  <p>EDIT:
  To clarify I mean let the compiler know that the value in the task may be null.
  I suppose the reverse is also true.
  I'm mostly interested in how this is supposed to work with the new C# nullable reference syntax.</p>
  <p>I can do something like this just fine</p>
  <pre><code>    var a = await GetAsync&lt;string?&gt;(); // a is null
      var b = await GetAsync&lt;int?&gt;(); // b is null
      var c = await GetAsync&lt;string&gt;(); // c is null.  Wait string is not supposed to be null and the compiler won't warn you if you use it!
      var d = await GetAsync&lt;int&gt;(); // d is 0
  </code></pre>
  <p>EDIT:
  I can do something like this just fine</p>
  <pre><code>    var a = await Get&lt;string?&gt;(); // a is null
      var b = await Get&lt;int?&gt;(); // b is null
      var c = await Get&lt;string&gt;(); // c is null.  
      var d = await Get&lt;int&gt;(); // d is 0
  </code></pre>
  <p>The suggestion of <a href="https://stackoverflow.com/questions/55975211/nullable-reference-types-how-to-specify-t-type-without-constraining-to-class">Nullable reference types: How to specify &quot;T?&quot; type without constraining to class or struct</a> is similar, but the Box class can be modified to provide the proper warnings where I cannot change the implementation of Task.</p>