mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-21 05:51:25 +07:00
overload resolution: don't skip errors from another context (IDEA-151119)
This commit is contained in:
@@ -1139,9 +1139,7 @@ public class InferenceSession {
|
||||
}
|
||||
|
||||
private PsiType registerIncompatibleErrorMessage(InferenceVariable var, @NotNull String incompatibleBoundsMessage) {
|
||||
if (var.getCallContext() == myContext) {
|
||||
registerIncompatibleErrorMessage(incompatibleBoundsMessage);
|
||||
}
|
||||
registerIncompatibleErrorMessage(incompatibleBoundsMessage);
|
||||
return PsiType.NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,10 @@ abstract class NoFormalParamTypeInferenceNeeded {
|
||||
Integer zip = zip(a -> zip(<error descr="no instance(s) of type variable(s) exist so that Object conforms to Integer
|
||||
inference variable R has incompatible bounds:
|
||||
lower bounds: Object
|
||||
upper bounds: Object, Integer">text -> text</error>));
|
||||
upper bounds: Object, Integer
|
||||
inference variable R has incompatible bounds:
|
||||
lower bounds: Object
|
||||
upper bounds: Object, R, Integer">text -> text</error>));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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){
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
}
|
||||
@@ -200,6 +200,10 @@ public class OverloadResolutionTest extends LightDaemonAnalyzerTestCase {
|
||||
doTest(true);
|
||||
}
|
||||
|
||||
public void testPreserveErrorsFromOuterVariables() throws Exception {
|
||||
doTest(true);
|
||||
}
|
||||
|
||||
private void doTest() {
|
||||
doTest(true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user