title: Why cannot IEnumerable<struct> be cast as IEnumerable<object>?
body: <p>Why is the last line not allowed?</p>
  
  <pre><code>IEnumerable&lt;double&gt; doubleenumerable = new List&lt;double&gt; { 1, 2 };
  IEnumerable&lt;string&gt; stringenumerable = new List&lt;string&gt; { "a", "b" };
  IEnumerable&lt;object&gt; objects1 = stringenumerable; // OK
  IEnumerable&lt;object&gt; objects2 = doubleenumerable; // Not allowed
  </code></pre>
  
  <p>Is this because double is a value type that doesn't derive from object, hence the covariance doesn't work?</p>
  
  <p>Does that mean that there is no way to make this work:</p>
  
  <pre><code>public interface IMyInterface&lt;out T&gt;
  {
      string Method(); 
  }
  
  public class MyClass&lt;U&gt; : IMyInterface&lt;U&gt;
  {
      public string Method()
      {
          return "test";
      }
  }
  
  public class Test
  {
      public static object test2() 
      {
          IMyInterface&lt;double&gt; a = new MyClass&lt;double&gt;();
          IMyInterface&lt;object&gt; b = a; // Invalid cast!
          return b.Method();
      }
  }
  </code></pre>
  
  <p>And that I need to write my very own <code>IMyInterface&lt;T&gt;.Cast&lt;U&gt;()</code> to do that?</p>