title: Generic inheritance in C#: Cannot implicitly convert type 'MyWidget' to 'IWidget'
body: <p>I'm having a problem setting up inheritance with generics.  </p>
  
  <p>In essence what I want to do is have a generic interface that itself accepts an interface.  the tricky part is that "inner" interface could have a more specific interface layered on top of it.</p>
  
  <p>Here is a representative sample of the structure that I'm trying to build:</p>
  
  <pre><code>public interface IThing  { }
  
  public interface IMoreSpecificThing : IThing  {  }
  
  public interface IWidget&lt;T&gt; where T : IThing  {  }
  
  public class MySpecificThing : IMoreSpecificThing { }
  
  public class MyWidget : IWidget&lt;MySpecificThing&gt; { }
  
  public class MyClass
  {
      public IWidget&lt;IThing&gt; MyProperty { get; set; }
  
      public MyClass()
      {
          MyProperty = new MyWidget();
      }
  }
  </code></pre>
  
  <p>The problem is that when I assign MyWidget to MyProperty, I receive the following error:</p>
  
  <blockquote>
    <p>Cannot implicitly convert type <code>'MyWidget'</code> to <code>'IWidget&lt;IThing&gt;'</code>. An
    explicit conversion exists (are you missing a cast?)</p>
  </blockquote>
  
  <p>What am I doing wrong, and is there a way to do this properly?</p>