title: weird typing error with private iterator in generic class
body: <p>I'm implementing a linked list in Java 1.7 and I don't understand this behaviour. The parts of the code that matter are this:</p>
  
  <pre><code>public class LListSent&lt;T&gt; implements Iterable&lt;T&gt;{
    //...
    public T get(int pos) {
        //...
    }
    //...
    private class LListSentIterator {
        private final LListSent list;
        private int currPos;
        private LListSentIterator(LListSent list) {
            this.list = list;
            currPos = 0;
        }
        //...
        @Override
        public T next() {
            return list.get(currPos++); //exception in this line
        }
    }
  }
  </code></pre>
  
  <p>The exception I get is:</p>
  
  <pre><code>incompatible Type: Object cannot be converted to T
    where T is a type-variable:
      T extends Object declared in class LListSent
  </code></pre>
  
  <p>eve though left.get return a <code>T</code> object. Why does this happen?</p>