From 107abaf891acdb7d1c9d1ca9c695ff72a126b36b Mon Sep 17 00:00:00 2001 From: "Anna.Kozlova" Date: Fri, 20 May 2016 21:44:12 +0200 Subject: [PATCH] good code red: applicability check for non-generic method requires types calculation --- .../com/intellij/codeInsight/ExceptionUtil.java | 3 +-- .../newLambda/VarargMethodWithThrownTypes.java | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/java/java-psi-impl/src/com/intellij/codeInsight/ExceptionUtil.java b/java/java-psi-impl/src/com/intellij/codeInsight/ExceptionUtil.java index 53eba439b164..7f9c6cc8194c 100644 --- a/java/java-psi-impl/src/com/intellij/codeInsight/ExceptionUtil.java +++ b/java/java-psi-impl/src/com/intellij/codeInsight/ExceptionUtil.java @@ -474,8 +474,7 @@ public class ExceptionUtil { PsiElement element = info.getElement(); if (info instanceof MethodCandidateInfo && MethodSignatureUtil.areSignaturesEqual(method, (PsiMethod)element) && - !MethodSignatureUtil.isSuperMethod((PsiMethod)element, method) && - ((MethodCandidateInfo)info).isApplicable()) { + !MethodSignatureUtil.isSuperMethod((PsiMethod)element, method)) { return Pair.create((PsiMethod)element, ((MethodCandidateInfo)info).getSubstitutor(false)); } return null; diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/newLambda/VarargMethodWithThrownTypes.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/newLambda/VarargMethodWithThrownTypes.java index 469226af3380..05c6e367183b 100644 --- a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/newLambda/VarargMethodWithThrownTypes.java +++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/newLambda/VarargMethodWithThrownTypes.java @@ -29,3 +29,20 @@ class Reproduction V apply(String s) throws IOException; } } + +class InferenceInVarargsParam { + static class Pair { + static Pair create(T t, K k) { + return null; + } + } + protected void assertPathListEditor(String text, Pair... expectedTableItems) throws Exception {} + + void testPathListSettingsEditor() throws Exception { + assertPathListEditor("", + Pair.create("foo", false), + Pair.create("bar", true), + Pair.create("$(PROJECT_DIR)/hello", false), + Pair.create("$(PROJECT_DIR)/hello", true)); + } +}