mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
inference when incomplete
This commit is contained in:
+5
@@ -52,6 +52,11 @@ public class ExpressionCompatibilityConstraint extends InputOutputConstraintForm
|
||||
}
|
||||
|
||||
final PsiType exprType = myExpression.getType();
|
||||
|
||||
if (exprType instanceof PsiLambdaParameterType) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (exprType != null && exprType != PsiType.NULL) {
|
||||
constraints.add(new TypeCompatibilityConstraint(myT, exprType));
|
||||
}
|
||||
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
import java.util.Optional;
|
||||
import java.util.function.Function;
|
||||
|
||||
class Calls {
|
||||
<A> Optional<A> a(A a) {return null;}
|
||||
<B> B b(Optional<B> a) {return null;}
|
||||
<C> Optional<C> c(C a) {return null;}
|
||||
|
||||
void foo(Function<String, Optional> computable) {}
|
||||
|
||||
{
|
||||
((x) -> a(b(c<error descr="'c(java.lang.Object)' in 'Calls' cannot be applied to '(<lambda parameter>)'">(x)</error>)));
|
||||
}
|
||||
}
|
||||
+4
@@ -38,6 +38,10 @@ public class FunctionalExpressionIncompleteHighlightingTest extends LightDaemonA
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testInsideParenthesis() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
private void doTest() {
|
||||
doTest(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user