mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-22 06:21:25 +07:00
inference: don't traverse up through lambda bounds when parent inference was already started, in this case it's exception inference which should work without top level node (EA-83073 - assert: LambdaUtil.treeWalkUp; IDEA-173467)
This commit is contained in:
@@ -771,8 +771,7 @@ public class LambdaUtil {
|
||||
}
|
||||
final MethodCandidateInfo.CurrentCandidateProperties properties = MethodCandidateInfo.getCurrentMethod(psiCall.getArgumentList());
|
||||
if (properties != null) {
|
||||
if (properties.isApplicabilityCheck() ||
|
||||
lambdaExpression != null && lambdaExpression.hasFormalParameterTypes()) {
|
||||
if (properties.isApplicabilityCheck() || lambdaExpression != null) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
package foo;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
class Test {
|
||||
|
||||
public void setup(OngoingStubbing<Map<String, List<String>>> stubbing) throws ReflectiveOperationException {
|
||||
stubbing.thenAnswer(inv -> to<caret>Map((Collection) inv.getArguments()[0], periodic((String) null)));
|
||||
}
|
||||
|
||||
private <K, V> Map<K, V> toMap(Collection<K> keys, V v) {
|
||||
return Collections.emptyMap();
|
||||
}
|
||||
|
||||
private <T> List<T> periodic(T t) throws ReflectiveOperationException {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
abstract class OngoingStubbing<T> {
|
||||
abstract OngoingStubbing<T> thenAnswer(Answer<?> answer);
|
||||
}
|
||||
|
||||
interface Answer<T> {
|
||||
T answer(InvocationOnMock invocation) throws Throwable;
|
||||
}
|
||||
|
||||
interface InvocationOnMock {
|
||||
Object[] getArguments();
|
||||
}
|
||||
@@ -138,6 +138,10 @@ public class Java8ExpressionsCheckTest extends LightDaemonAnalyzerTestCase {
|
||||
doTestConfiguredFile(false, false, filePath);
|
||||
}
|
||||
|
||||
public void testCheckedExceptionConstraintToTopLevel() throws Exception {
|
||||
doTestCachedUnresolved();
|
||||
}
|
||||
|
||||
private void doTestCachedUnresolved() {
|
||||
configureByFile(BASE_PATH + "/" + getTestName(false) + ".java");
|
||||
PsiMethodCallExpression callExpression =
|
||||
|
||||
Reference in New Issue
Block a user