Files
openide/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/newLambda/OperatorApplicabilityInUnresolvedLambdas.java
Tagir Valeev f592c31876 [java-highlighting] Do not report incompatible type problems when operand is lambda parameter having unknown type
Such kind of error is induced by lambda resolution error, and in most of the cases the resolution error should be fixed first
Fixes IDEA-361893 "Introduce local variable" should suggest for Function expression

GitOrigin-RevId: 352d0f9040dd3e153e7d5b15ae61699b8c890194
2024-12-10 16:14:02 +00:00

16 lines
636 B
Java

class Test {
int field;
void foo() {
<error descr="Not a statement">i -> i + 1;</error>
<error descr="Not a statement">i -> 1 + i;</error>
<error descr="Not a statement">i -> 1 + 2 + i;</error>
<error descr="Not a statement">i -> 1 + i + 2;</error>
i -> <error descr="Operator '-' cannot be applied to 'int', 'java.lang.String'">1 - "xyz" - i</error>;
foo<error descr="Expected no arguments but found 1">(i -> ++i)</error>;
<error descr="Cannot resolve method 'bar' in 'Test'">bar</error>(i -> i += 2);
<error descr="Cannot resolve method 'bar' in 'Test'">bar</error>(i -> field += i);
}
}