mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
new inference: postpone resolution of independent vars (IDEA-125674)
This commit is contained in:
+1
-18
@@ -830,24 +830,7 @@ public class InferenceSession {
|
||||
}
|
||||
|
||||
private boolean proceedWithAdditionalConstraints(Set<ConstraintFormula> additionalConstraints) {
|
||||
final Set<InferenceVariable> mentionedVars = new HashSet<InferenceVariable>();
|
||||
for (ConstraintFormula constraint : additionalConstraints) {
|
||||
if (constraint instanceof InputOutputConstraintFormula) {
|
||||
final Set<InferenceVariable> inputVariables = ((InputOutputConstraintFormula)constraint).getInputVariables(this);
|
||||
if (inputVariables != null) {
|
||||
mentionedVars.addAll(inputVariables);
|
||||
}
|
||||
final Set<InferenceVariable> outputVariables = ((InputOutputConstraintFormula)constraint).getOutputVariables(inputVariables, this);
|
||||
if (outputVariables != null) {
|
||||
mentionedVars.addAll(outputVariables);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
final Set<InferenceVariable> readyVariables = new LinkedHashSet<InferenceVariable>(myInferenceVariables.values());
|
||||
readyVariables.removeAll(mentionedVars);
|
||||
|
||||
final PsiSubstitutor siteSubstitutor = resolveBounds(readyVariables, mySiteSubstitutor);
|
||||
final PsiSubstitutor siteSubstitutor = mySiteSubstitutor;
|
||||
|
||||
while (!additionalConstraints.isEmpty()) {
|
||||
//extract subset of constraints
|
||||
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
class Test {
|
||||
void foo(final Stream<String> stream){
|
||||
stream.collect(Collectors.toMap(s -> s, s -> s, (a, b) -> a.length() > b. length() ? a : b));
|
||||
}
|
||||
}
|
||||
+3
@@ -62,7 +62,10 @@ public class NewLambdaHighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
public void testIDEA120992() { doTest(); }
|
||||
public void testTargetTypeConflictResolverShouldNotTryToEvaluateCurrentArgumentType() { doTest(); }
|
||||
public void testIDEA119535() { doTest(); }
|
||||
|
||||
@Bombed(day = 20, month = Calendar.AUGUST)
|
||||
public void testIDEA119003() { doTest(); }
|
||||
public void testIDEA125674() { doTest(); }
|
||||
public void testIDEA117124() { doTest(); }
|
||||
public void testWildcardParameterization() { doTest(); }
|
||||
public void testDiamondInLambdaReturn() { doTest(); }
|
||||
|
||||
Reference in New Issue
Block a user