mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
new inference: proceed with additional constraints when no nested calls available (IDEA-124424)
This commit is contained in:
+2
-1
@@ -221,7 +221,8 @@ public class InferenceSession {
|
||||
return prepareSubstitution();
|
||||
}
|
||||
|
||||
if (parameters != null && args != null && !MethodCandidateInfo.isOverloadCheck()) {
|
||||
if (parameters != null && args != null &&
|
||||
!MethodCandidateInfo.ourOverloadGuard.currentStack().contains(PsiUtil.skipParenthesizedExprUp(parent.getParent()))) {
|
||||
final Set<ConstraintFormula> additionalConstraints = new LinkedHashSet<ConstraintFormula>();
|
||||
if (parameters.length > 0) {
|
||||
collectAdditionalConstraints(parameters, args, properties.getMethod(), PsiSubstitutor.EMPTY, additionalConstraints, properties.isVarargs(), true);
|
||||
|
||||
+1
-1
@@ -92,7 +92,7 @@ public class PsiConditionalExpressionImpl extends ExpressionPsiElement implement
|
||||
|
||||
if (PsiUtil.isLanguageLevel8OrHigher(this) &&
|
||||
PsiPolyExpressionUtil.isPolyExpression(this) &&
|
||||
!MethodCandidateInfo.ourOverloadGuard.currentStack().contains(this.getParent())) {
|
||||
!MethodCandidateInfo.ourOverloadGuard.currentStack().contains(PsiUtil.skipParenthesizedExprUp(this.getParent()))) {
|
||||
//15.25.3 Reference Conditional Expressions
|
||||
// The type of a poly reference conditional expression is the same as its target type.
|
||||
return InferenceSession.getTargetType(this);
|
||||
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import static java.util.stream.Collectors.toList;
|
||||
|
||||
class Main {
|
||||
void bar(final Stream<Object> objectStream) {
|
||||
foo(objectStream.map(o -> "str").collect(toList()));
|
||||
}
|
||||
|
||||
void foo(Iterable<?> k){}
|
||||
void foo(String s){}
|
||||
}
|
||||
+1
@@ -92,6 +92,7 @@ public class NewLambdaHighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
public void testIDEA124961() { doTest(); }
|
||||
public void testIDEA126109() { doTest(); }
|
||||
public void testIDEA126809() { doTest(); }
|
||||
public void testIDEA124424() { doTest(); }
|
||||
|
||||
public void testIDEA127596() throws Exception {
|
||||
doTest();
|
||||
|
||||
Reference in New Issue
Block a user