inference when incomplete

This commit is contained in:
Anna Kozlova
2014-05-01 15:33:10 +04:00
parent 6f6367d5b6
commit 8096d635a6
3 changed files with 23 additions and 0 deletions
@@ -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));
}
@@ -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>)));
}
}
@@ -38,6 +38,10 @@ public class FunctionalExpressionIncompleteHighlightingTest extends LightDaemonA
doTest();
}
public void testInsideParenthesis() throws Exception {
doTest();
}
private void doTest() {
doTest(false);
}