mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
new inference: accept inferred equals bounds even when additional constraints lead to failure to get more appropriate error message (IDEA-139275)
This commit is contained in:
+1
-1
@@ -269,7 +269,7 @@ public class InferenceSession {
|
||||
}
|
||||
|
||||
if (!additionalConstraints.isEmpty() && !proceedWithAdditionalConstraints(additionalConstraints)) {
|
||||
return prepareSubstitution();
|
||||
return prepareSubstitution().putAll(retrieveNonPrimitiveEqualsBounds(myInferenceVariables));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
import java.io.Reader;
|
||||
import java.util.Arrays;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
class Test {
|
||||
|
||||
public static void main(String[] args) {
|
||||
Iterable<Consumer<Reader>> i = Arrays.asList((r) -> <error descr="Unhandled exception: java.io.IOException">r.read()</error>);
|
||||
Iterable<Consumer<Reader>> i1 = Arrays.<Consumer<Reader>>asList((r) -> <error descr="Unhandled exception: java.io.IOException">r.read()</error>);
|
||||
}
|
||||
}
|
||||
+4
@@ -189,6 +189,10 @@ public class NewLambdaHighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testAcceptInferredVariablesBeforeAdditionalConstraintsLeadToFail() throws Exception {
|
||||
doTest(false);
|
||||
}
|
||||
|
||||
private void doTest() {
|
||||
doTest(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user