IDEA-122616

This commit is contained in:
Anna Kozlova
2014-03-21 18:28:36 +01:00
parent 0a516f5166
commit 60acb4b9b2
5 changed files with 32 additions and 10 deletions
@@ -1,8 +1,8 @@
class IntStream {
private void foo(IntStream s) {
s.map(i -> <error descr="Operator '<<' cannot be applied to 'int', '<lambda parameter>'">1 << i</error>);
s.map<error descr="Ambiguous method call: both 'IntStream.map(IntUnaryOperator)' and 'IntStream.map(ObjIntFunction<Integer>)' match">(i -> 1 << i)</error>;
s.map<error descr="Ambiguous method call: both 'IntStream.map(IntUnaryOperator)' and 'IntStream.map(ObjIntFunction<Integer>)' match">(i -> 1)</error>;
s.map<error descr="Ambiguous method call: both 'IntStream.map(IntUnaryOperator)' and 'IntStream.map(ObjIntFunction<T>)' match">(i -> i)</error>;
s.map<error descr="Ambiguous method call: both 'IntStream.map(IntUnaryOperator)' and 'IntStream.map(ObjIntFunction<Integer>)' match">(i -> i)</error>;
}
public static void main(String[] args) {
@@ -25,7 +25,7 @@ class ReturnTypeIncompatibility {
}
public static void main(String[] args) {
call<error descr="Ambiguous method call: both 'ReturnTypeIncompatibility.call(I1<P>)' and 'ReturnTypeIncompatibility.call(I2<P>)' match">(i-> {return i;})</error>;
call<error descr="Ambiguous method call: both 'ReturnTypeIncompatibility.call(I1<Integer>)' and 'ReturnTypeIncompatibility.call(I2<P>)' match">(i-> {return i;})</error>;
}
}
@@ -0,0 +1,18 @@
import java.util.function.Function;
class ChoiceBox<T> {
static {
ChoiceBox<Item> confParamField1 = new ChoiceBox<>("", p -> p.getName());
ChoiceBox<Item> confParamField2 = new ChoiceBox<Item>("", p -> p.getName());
}
public ChoiceBox(T... options) {}
public ChoiceBox(String caption, Function<T, String> itemCaption) {}
public static class Item {
public String getName() {
return null;
}
}
}