fork download
  1. import java.util.*;
  2.  
  3. class Example {
  4. public static void main(String[] args) {
  5. m(new ArrayList<List<String>>());
  6. }
  7.  
  8. static <A extends List<B>, B extends List<C>, C> void m(A a) {}
  9. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:5: error: invalid inferred types for B,C; inferred type does not conform to declared bound(s)
        m(new ArrayList<List<String>>());
         ^
    inferred: List<String>
    bound(s): List<Object>
  where B,A,C are type-variables:
    B extends List<C> declared in method <A,B,C>m(A)
    A extends List<B> declared in method <A,B,C>m(A)
    C extends Object declared in method <A,B,C>m(A)
1 error
stdout
Standard output is empty