title: Cannot convert System.Threading.Tasks.Task... to System.Threading.Tasks.Task... despite seemingly being same type
body: <p>I'm getting a strange error in Rider eluding to the fact that I am trying to convert to a Task in a way that's not allowed. The odd part is that the types seem to be an exact match.</p>
  <p><strong>Code throwing error</strong></p>
  <pre><code>        public IEnumerator GetCatalogItem_LevelDataId_PlayFabCatalogItemFound(string levelName,long levelDataId)
          {
              //Arrange
              const string getCatalogItemCloudFunctionName = &quot;getCatalogItem&quot;;
              var data = new Dictionary&lt;string, object&gt;
              {
                  {&quot;itemId&quot;, levelDataId.ToString()}
              };
              //Act
              var result = FirebaseFunctions.DefaultInstance
                  .GetHttpsCallable(getCatalogItemCloudFunctionName)
                  .CallAsync(data);
              //BUG ERROR IS SHOWN ON result BELOW (SEE ATTACHED IMAGE)
              yield return result.AsIEnumerator&lt;HttpsCallableResult&gt;();
              var catalogItem = (IDictionary)result.Result.Data;
              //Assert
              Assert.AreEqual(levelName,catalogItem[&quot;DisplayName&quot;].ToString());
          }
  </code></pre>
  <p><strong>Task Extention Method Used</strong></p>
  <pre><code>    public static class TaskExtensions
      {
          /// &lt;summary&gt;
          /// Converts a &lt;see cref=&quot;System.Threading.Tasks.Task&quot;/&gt; to &lt;see cref=&quot;IEnumerator&quot;/&gt; (helps with unity coroutines)
          /// &lt;/summary&gt;
          /// &lt;param name=&quot;task&quot;&gt;The task to convert&lt;/param&gt;
          /// &lt;returns&gt;An IEnumerator which waits till the task has been completed&lt;/returns&gt;
          public static IEnumerator AsIEnumerator(this Task task)
          {
              while (!task.IsCompleted)
              {
                  yield return null;
              }
  
              if (task.IsFaulted)
              {
                  throw task.Exception;
              }
          }
          
          /// &lt;inheritdoc cref=&quot;AsIEnumerator&quot;/&gt;
          public static IEnumerator AsIEnumerator&lt;T&gt;(this Task&lt;T&gt; task)
          {
              while (!task.IsCompleted)
              {
                  yield return null;
              }
  
              if (task.IsFaulted)
              {
                  throw task.Exception;
              }
          }
      }
  </code></pre>
  <p><strong>Error Thrown</strong></p>
  <blockquote>
  <p>Cannot convert instance argument type 'System.Threading.Tasks.Task&lt;Firebase.Functions.HttpsCallableResult&gt; [Firebase.Functions, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]' to 'System.Threading.Tasks.Task&lt;Firebase.Functions.HttpsCallableResult&gt; [mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]'</p>
  </blockquote>
  <p><a href="https://i.stack.imgur.com/myy1t.png" rel="nofollow noreferrer">Task Error Image</a></p>