mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
java applicability checks: do not calculate type when it won't be used
GitOrigin-RevId: 65e177cf43a5c4d81b888079bb280f38599604a8
This commit is contained in:
committed by
intellij-monorepo-bot
parent
3ae38e0404
commit
3c6b2f5519
@@ -658,9 +658,9 @@ public class LambdaUtil {
|
||||
}
|
||||
}
|
||||
else if (body instanceof PsiExpression) {
|
||||
final PsiType type = ((PsiExpression)body).getType();
|
||||
try {
|
||||
if (!PsiUtil.isStatement(JavaPsiFacade.getElementFactory(body.getProject()).createStatementFromText(body.getText(), body))) {
|
||||
final PsiType type = ((PsiExpression)body).getType();
|
||||
if (PsiType.VOID.equals(type)) {
|
||||
errors.put(body, "Lambda body must be a statement expression");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user