lambda: use wildcard bound for inferred param

This commit is contained in:
anna committed 2012-07-20 18:59:19 +02:00
1 parent c3276bd56e
commit 01aefae9db
2 files changed
+22 -1

No files matched your search

@@ -57,4 +57,18 @@ class CastInference {
foo((I1<Integer>)() -> 42);
I1<Integer> i1 = (I1<Integer>)() -> 42;
}
}
class WildcardBoundsUsage {
interface I<X> {
boolean foo(X x);
}
public I<Character> bar(I<? super Character> predicate) {
return null;
}
{
I<Character> i = bar(c -> c.compareTo('x') < 0);
}
}