applicability: get call expr from anonymous class (IDEA-184965)

This commit is contained in:
Anna Kozlova
2018-01-15 20:27:05 +01:00
parent 7ac397bb3d
commit e037922937
3 changed files with 12 additions and 0 deletions
@@ -196,6 +196,9 @@ public class InferenceSession {
if (parent instanceof PsiCall) {
return MethodCandidateInfo.getCurrentMethod(((PsiCall)parent).getArgumentList());
}
if (parent instanceof PsiAnonymousClass) {
return getCurrentProperties(parent.getParent());
}
return null;
}
@@ -0,0 +1,8 @@
abstract class Test {
public <T> Test(final T t, int i) { }
{
Test action = new Test<error descr="'Test(T, int)' in 'Test' cannot be applied to '(java.lang.String, java.lang.String)'">("abc", "name")</error> {};
}
}
@@ -175,6 +175,7 @@ public class GraphInferenceHighlightingTest extends LightDaemonAnalyzerTestCase
public void testErasureOfReturnTypeIffUncheckedConversionWasNecessaryDuringApplicabilityCheckOnly2() { doTest(); }
public void testTwoDifferentParameterizationCheckWithInterfaceTypeArguments() { doTest(); }
public void testNonGenericInnerClassOfGenericsOuterInReturnType() { doTest(); }
public void testInferredApplicabilityForAnonymousClassConstructor() { doTest(); }
public void testNonGenericInnerClassOfGenericsOuterWithWildcardsInReturnType() { doTest(); }
public void testUncheckedConversionDuringProperTypeExpressionConstraintResolution() { doTest(); }
//public void _testAssignabilityOfStandaloneExpressionsDuringApplicabilityCheck() { doTest(); }