title: Task<byte[]> method warns about implicit cast without async
body: <p>I have created a method to gather entropy for my application.<br>
  I've put this in a Task to provide an asynchronous operation for the caller.<br>
  I want to avoid a forever loop when collecting entropy from the sensors so I used a timeout which defaults to using <code>RNGCryptoServiceProvider.GetBytes()</code> method.<br></p>
  
  <pre><code>public Task&lt;byte[]&gt; GetEntropy1(int length)
  {
      RNGCryptoServiceProvider entropyGen = new RNGCryptoServiceProvider();
      byte[] entropyBuffer = new byte[2048];
  
      try
      {
          semaphore.Wait();
  
          Task t = Task.Run(() =&gt;
          {
              /* gather entropy from sensors */
          });
  
          if (!t.Wait(5000))
          {
              entropyGen.GetBytes(entropyBuffer);
          }
          return entropyBuffer;
      }
      catch (Exception)
      {
          return entropyBuffer;
      }
      finally
      {
          this.semaphore.Release();
      }
  }
  </code></pre>
  
  <p>But I don't understand why when I return the byte array, I get a warning about implicit cast.<br>
  <strong>Cannot implicitly convert type 'byte[]' to 'System.Threading.Tasks.Task'</strong></p>
  
  <p>If I use an <code>async</code> in the function definition, then that warning goes away.</p>