Java: fix exception on incomplete code (IDEA-375071)

in "Unnecessary local variable" inspection

GitOrigin-RevId: 3c0cf1abec084a91727e23ec19bb1acf815de9db
This commit is contained in:
Bas Leijdekkers
2025-06-30 18:41:25 +00:00
committed by intellij-monorepo-bot
parent a499281501
commit bb71ba1c2a
2 changed files with 14 additions and 3 deletions
@@ -232,4 +232,15 @@ abstract class RedundantLocalInFor {
}
protected abstract RedundantLocalInFor getParent();
void incompleteLambda() {
<error descr="Cannot infer type: lambda expression requires an explicit target type">var</error> z = s -> {
final Object s1 = s;
return x(s1) ;
};
}
boolean x(Object o) {
return false;
}
}