fork(1) download
  1. import java.util.*;
  2. import java.lang.*;
  3.  
  4. interface A extends Comparable<A>{}
  5. interface B extends Comparable<B>{}
  6.  
  7. class Main
  8. {
  9. public static void foo(Integer x){}
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. foo(true ? (A)null : (B)null);
  13. }
  14. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:12: error: method foo in class Main cannot be applied to given types;
		foo(true ? (A)null : (B)null);
		^
  required: Integer
  found: Comparable<CAP#1>
  reason: actual argument Comparable<CAP#1> cannot be converted to Integer by method invocation conversion
  where CAP#1 is a fresh type-variable:
    CAP#1 extends Comparable<?> from capture of ? extends Comparable<?>
1 error
stdout
Standard output is empty