fork(1) download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. interface MyInterface<T> {
  11.  
  12. <T> T test(T t);
  13. }
  14.  
  15. static <T> T foo(T t) { return t; }
  16.  
  17. public static void main (String[] args) throws java.lang.Exception
  18. {
  19. MyInterface<?> x = Ideone::foo;
  20. MyInterface<?> y = a -> a;
  21. }
  22. }
Compilation error #stdin compilation error #stdout 0.09s 48080KB
stdin
Standard input is empty
compilation info
Main.java:20: error: incompatible types: invalid functional descriptor for lambda expression
		MyInterface<?> y = a -> a;
		                   ^
    method <T>(T)T in interface MyInterface is generic
  where T is a type-variable:
    T extends Object declared in method <T>test(T)
1 error
stdout
Standard output is empty