I have a class with the following definition:
public abstract class A<T> implements Iterator<B> {}
The following call to next() will return an Object rather than a B:
A a = new SomethingThatExtendsA();
B b = a.next();
I've searched for quite awhile and haven't been able to figure out why this next() call fails to compile. Is anyone able to describe this behavior for me?
Edited original to be templated, as this seems to matter.
Edit for additional clarification: This is a compile-time issue, not a runtime issue. The implementation of SomethingThatExtendsA(); should be irrelevant in this case at compile-time.