mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-19 13:02:30 +07:00
inference: ensure don't walk through explicitly specified type
This commit is contained in:
@@ -825,7 +825,7 @@ public class LambdaUtil {
|
||||
break;
|
||||
}
|
||||
|
||||
final PsiCall psiCall = PsiTreeUtil.getParentOfType(parent, PsiCall.class, false, PsiMember.class);
|
||||
final PsiCall psiCall = PsiTreeUtil.getParentOfType(parent, PsiCall.class, false, PsiMember.class, PsiVariable.class);
|
||||
if (psiCall == null) {
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
|
||||
import java.util.function.Supplier;
|
||||
|
||||
interface DuallyParametric<A0> {
|
||||
default <R> R match(Supplier<R> bFn) {
|
||||
return null;
|
||||
}
|
||||
|
||||
static <Ab> DuallyParametric<Ab> b() {
|
||||
return null;
|
||||
}
|
||||
|
||||
static void foldLeft(Runnable fn) {}
|
||||
|
||||
default void merge(DuallyParametric<A0> first) {
|
||||
foldLeft(() -> {
|
||||
Supplier<DuallyParametric<A0>> bDuallyParametricFunction = () -> first.match(() -> b());
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -39,6 +39,10 @@ public class NewInferenceCollectingAdditionalConstraintsTest extends LightDaemon
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testNestedLambdaExpressionsWithTopStandaloneMethod() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
private void doTest() {
|
||||
IdeaTestUtil.setTestVersion(JavaSdkVersion.JDK_1_8, getModule(), getTestRootDisposable());
|
||||
doTest(BASE_PATH + "/" + getTestName(false) + ".java", true, false);
|
||||
|
||||
Reference in New Issue
Block a user