generics: inaccessible through wildcards bounds

This commit is contained in:
anna
2012-10-31 17:49:57 +01:00
parent 493ce886dd
commit 2c5603f241
3 changed files with 15 additions and 1 deletions
@@ -118,7 +118,7 @@ public class CandidateInfo implements JavaResolveResult {
if (element instanceof PsiMethod) {
final PsiType returnType = ((PsiMethod)element).getReturnType();
final PsiType substitutedReturnType = resolveResult.getSubstitutor().substitute(returnType);
if (substitutedReturnType instanceof PsiCapturedWildcardType) {
if (substitutedReturnType instanceof PsiCapturedWildcardType || substitutedReturnType instanceof PsiWildcardType) {
return true;
}
}
@@ -0,0 +1,13 @@
class JavacConfiguration {
private final String mySettings = "";
public static void foo(Class<? extends JavacConfiguration> aClass) {
Object o = getService(aClass).<error descr="'mySettings' has private access in 'JavacConfiguration'">mySettings</error>;
JavacConfiguration configuration = getService(aClass);
String string = configuration.mySettings;
}
public static <T> T getService(Class<T> serviceClass) {
return null;
}
}
@@ -181,6 +181,7 @@ public class GenericsHighlightingTest extends LightDaemonAnalyzerTestCase {
public void testIDEA57311() throws Exception { doTest(false); }
public void testIDEA57309() throws Exception { doTest(false); }
public void testIDEA90802() throws Exception { doTest(false); }
public void testInaccessibleThroughWildcard() throws Exception { doTest17Incompatibility();}
public void testInconvertibleTypes() throws Exception { doTest(false); }
public void testIncompatibleReturnType() throws Exception { doTest(false); }
public void testContinueInferenceAfterFirstRawResult() throws Exception { doTest(false); }