title: Not able to compile code containing generics and inner classes
body: <p>I am trying to implement Singly Linked List. I am not able to compile the following code. I have removed lot of unnecessary code which is not relevant for this question from the below snippet:</p>
  
  <pre><code>public class SinglyLinkedList&lt;T&gt;
  {
      public SinglyLinkedList()
      {
      }
  
      private SinglyNode&lt;T&gt; _head = null;
  
      private class SinglyNode&lt;T&gt;
      {
          public T Data { get; set; }
          public SinglyNode&lt;T&gt; Next { get; set; }
      }
  
      private class Enumerator&lt;T&gt;
      {
          public Enumerator(SinglyLinkedList&lt;T&gt; list)
          {
              _list = list; //#1
              _head = list._head; //#2
          }
  
          private SinglyLinkedList&lt;T&gt; _list = null;
          private SinglyNode&lt;T&gt; _head = null;
      }
  }
  </code></pre>
  
  <p>The statement marked #2 is failing with the error - <code>Cannot implicitly convert type 'SinglyLinkedList&lt;T&gt;.SinglyNode&lt;T&gt;' to 'SinglyLinkedList&lt;T&gt;.SinglyNode&lt;T&gt; Program.cs</code>   </p>
  
  <p>The statement marked #1 is semantically similar to #2 and it is compiling. What is stopping the program to compile? Are there any genercis + inner classes related rules that are causing the above code to not compile?</p>
  
  <p>Please make a note that the above code snippet is part of my learning by reinventing the wheel and is not a production code.</p>