Java CRTP and Wildcards: Code compiles in Eclipse but not `javac`
问题 Sorry for the vague title. I have this piece of code which compiles on Eclipse Juno (4.2) but not javac (1.7.0_09): package test; public final class Test { public static class N<T extends N<T>> {} public static class R<T extends N<T>> { public T o; } public <T extends N<T>> void p(final T n) {} public void v(final R<?> r) { p(r.o); // <-- javac fails on this line } } The error is: Test.java:13: error: method p in class Test cannot be applied to given types; p(r.o); ^ required: T found: N<CAP