overload resolution: don't skip errors from another context (IDEA-151119)

This commit is contained in:
Anna Kozlova
2016-02-02 13:37:45 +03:00
parent 2aa6d4fb87
commit a6625994fb
5 changed files with 30 additions and 5 deletions

View File

@@ -12,7 +12,10 @@ import java.util.function.Function;
class Test {
{
valueOf(processFirst(<error descr="no instance(s) of type variable(s) exist so that Integer conforms to char[]">x -> x</error>));
valueOf(processFirst(<error descr="no instance(s) of type variable(s) exist so that Integer conforms to char[]
inference variable V has incompatible bounds:
lower bounds: Integer
upper bounds: Object, char[]">x -> x</error>));
}
public static <V> V processFirst(Function<Integer,V> f){

View File

@@ -0,0 +1,17 @@
class Node {
private <<warning descr="Type parameter 'TB' is never used">TB</warning>> void <warning descr="Private method 'addChild(java.lang.String)' is never used">addChild</warning>(String color) {
System.out.println(color);
}
private <<warning descr="Type parameter 'TA' is never used">TA</warning>> void addChild(Node... nodes) {
System.out.println(nodes);
}
private <TC extends Node> TC setColor() {
return null;
}
{
addChild(setColor());
}
}