mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-20 13:31:28 +07:00
AIOOBE IDEA-103980
(cherry picked from commit 235e1ab6ff11856c91e6c5afded3209879ac473e)
This commit is contained in:
@@ -107,6 +107,7 @@ public class JavaMethodsConflictResolver implements PsiConflictResolver{
|
||||
final PsiMethod method = (PsiMethod)conflict.getElement();
|
||||
if (method != null) {
|
||||
final PsiParameter[] methodParameters = method.getParameterList().getParameters();
|
||||
if (methodParameters.length == 0) continue;
|
||||
final PsiParameter param = i < methodParameters.length ? methodParameters[i] : methodParameters[methodParameters.length - 1];
|
||||
final PsiType paramType = param.getType();
|
||||
if (!LambdaUtil.isAcceptable(lambdaExpression, conflict.getSubstitutor().substitute(paramType), true)) {
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
class Demo {
|
||||
|
||||
public void f1() {
|
||||
f2<error descr="'f2()' in 'Demo' cannot be applied to '(int, <lambda expression>)'">(2, input -> input)</error>;
|
||||
}
|
||||
|
||||
public void f2() {
|
||||
}
|
||||
|
||||
public void f2(Object... params) {
|
||||
}
|
||||
}
|
||||
@@ -86,6 +86,7 @@ public class LambdaHighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
public void testVoidCompatibility() { doTest(); }
|
||||
public void testConditionalInferenceFromOppositePart() { doTest(); }
|
||||
public void testDeclaredTypeParameterBoundsAndUnboundedWildcard() { doTest(); }
|
||||
public void testConflictResolution() throws Exception {doTest();}
|
||||
|
||||
private void doTest() {
|
||||
doTest(false);
|
||||
|
||||
Reference in New Issue
Block a user