fork download
  1. public class Main {
  2.  
  3. static class HasId<I> {}
  4. static class HasStringId extends HasId<String> {}
  5. static class Alert<T extends /*Some*/Object> extends HasStringId {}
  6. static class BaseController<M extends HasId<String>> {
  7. // abstract Class<M> getModelClass();
  8. }
  9. @SuppressWarnings("rawtypes")
  10. static class AlertController extends BaseController<Alert> { // error here
  11. // @Override Class<Alert> getModelClass() {
  12. // return Alert.class;
  13. // }
  14. }
  15.  
  16. public static void main(String[] args) { }
  17. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:10: error: type argument Alert is not within bounds of type-variable M
	static class AlertController extends BaseController<Alert> { // error here
	                                                    ^
  where M is a type-variable:
    M extends HasId<String> declared in class BaseController
1 error
stdout
Standard output is empty