generic compile problem

Radim Kolar hsn at filez.com
Tue Dec 11 13:59:07 PST 2012


i sent wrong example. This one is right, compiles only in eclipse.

class Generic<T> {}
public class Casting {
	void test() {
		Class<? extends Generic<?>> generic = (Class<? extends Generic<?>>) Generic.class;
	}
}

javac:
Casting.java:4: error: inconvertible types
                 Class<? extends Generic<?>> generic = (Class<? extends Generic<?>>) Generic.class;




More information about the compiler-dev mailing list