mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-06 11:50:54 +07:00
java inference: stop walkUp in assignment context inside method call chain (IDEA-217928)
GitOrigin-RevId: 79ac2370cd302d7e38d029e065ff4a28ed8709a4
This commit is contained in:
committed by
intellij-monorepo-bot
parent
6ebf3349dc
commit
bd882f2a97
@@ -752,7 +752,8 @@ public class LambdaUtil {
|
||||
break;
|
||||
}
|
||||
|
||||
final PsiCall psiCall = PsiTreeUtil.getParentOfType(parent, PsiCall.class, false, PsiMember.class, PsiVariable.class);
|
||||
final PsiCall psiCall = PsiTreeUtil.getParentOfType(parent, PsiCall.class, false, PsiMember.class, PsiVariable.class,
|
||||
PsiAssignmentExpression.class, PsiTypeCastExpression.class);
|
||||
if (psiCall == null) {
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
import java.util.*;
|
||||
import java.util.function.Supplier;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
class MyTest {
|
||||
void foo(Stream<Map.Entry<Object, Object>> stream) {
|
||||
Supplier<Map<Object, Object>> s = null;
|
||||
(s = () -> stream
|
||||
.collect(Collectors.toMap(
|
||||
entry -> entry.getKey(),
|
||||
Map.Entry::getValue
|
||||
))).get();
|
||||
((Supplier<Map<Object, Object>>) () -> stream
|
||||
.collect(Collectors.toMap(
|
||||
entry -> entry.getKey(),
|
||||
Map.Entry::getValue
|
||||
))).get();
|
||||
}
|
||||
}
|
||||
@@ -169,6 +169,7 @@ public class NewLambdaHighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
public void testFunctionalBound() { doTest(); }
|
||||
public void testValidFixesOnUnresolvedMethod() { doTest(); }
|
||||
public void testPolyExpressionInVoidCompatibleLambdaReturn() { doTest(); }
|
||||
public void testStopAtTypeCastWhenSearchForTopMostNode() { doTest(); }
|
||||
|
||||
private void doTest() {
|
||||
IdeaTestUtil.setTestVersion(JavaSdkVersion.JDK_1_8, getModule(), getTestRootDisposable());
|
||||
|
||||
Reference in New Issue
Block a user