functional interface suggester: check return types and try to infer

This commit is contained in:
Anna Kozlova
2014-12-12 19:28:55 +01:00
parent c138ff43f1
commit 9b4cacf341
7 changed files with 58 additions and 11 deletions
@@ -0,0 +1,20 @@
import java.util.function.Supplier;
class Test {
void bar() {
foo(new Supplier<String>() {
public String get() {
String s = "";
System.out.println(s);
return s;
}
});
}
void foo(Supplier<String> anObject) {
String s = anObject.get();
System.out.println(s);
}
}