I have a method defined like this:
public <T> T methodName(Class<T> clazz)
I my unit tests I erroneously test it like this:
Class clazz = Tag.class;
Tag tag = methodName(clazz);
This should produce a compile time error (and when I try to compile it with javac it produces a compile time error), but eclipse allows it to compile.
I really do not understand why eclipse allows this code to compile, can someone please provide some info why this would compile in eclipse?
The eclipse version is: Eclipse Java EE IDE for Web Developers. Version: Luna Service Release 2 (4.4.2) Build id: 20150219-0600
The java version used is: (Oracle) jdk 1.7.0_51.