mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
ensure additional constrains are collected based on ground functional type (IDEA-167277)
This commit is contained in:
+2
-1
@@ -501,7 +501,8 @@ public class InferenceSession {
|
||||
}
|
||||
else if (arg instanceof PsiLambdaExpression &&
|
||||
isPertinentToApplicability(arg, parentMethod)) {
|
||||
collectLambdaReturnExpression(additionalConstraints, ignoredConstraints, (PsiLambdaExpression)arg, parameterType,
|
||||
collectLambdaReturnExpression(additionalConstraints, ignoredConstraints, (PsiLambdaExpression)arg,
|
||||
FunctionalInterfaceParameterizationUtil.getGroundTargetType(parameterType, (PsiLambdaExpression)arg),
|
||||
!isProperType(initialSubstitutor.substitute(parameterType)),
|
||||
initialSubstitutor);
|
||||
}
|
||||
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.function.Supplier;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
class Main {
|
||||
|
||||
public void main(Stream<Entry<String, Object>> stream) {
|
||||
supp(() -> stream.collect(Collectors. toMap(Entry::getKey, Entry::getValue)));
|
||||
supp(() -> stream.collect(Collectors.toMap(e -> e.getKey(), e -> e.getValue())));
|
||||
}
|
||||
|
||||
void supp(Supplier<? extends Map<String, Object>> s) {}
|
||||
}
|
||||
+4
@@ -335,6 +335,10 @@ public class NewLambdaHighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testCollectLambdaAdditionalConstraintsByGroundType() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testInferTypeParametersFromFunctionalInterfaceInputs() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user