Created
May 10, 2014 03:13
-
-
Save kputnam/d8013e5f8a7496963d27 to your computer and use it in GitHub Desktop.
Type parameter instantiation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package test; | |
public class Test { | |
public static class Generic<A, B> { } | |
public static class Instance extends Generic<String, String> { } | |
// OK | |
Class<? extends Generic<String, String>> w = Instance.class; | |
/** | |
* Test.java: error: incompatible types | |
* Class<Generic<String, String>> x = Generic.class; | |
* ^ | |
* required: Class<Generic<String,String>> | |
* found: Class<Generic> | |
*/ | |
Class<Generic<String, String>> x = Generic.class; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment