mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
generics: inaccessible through wildcards bounds
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
+13
@@ -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); }
|
||||
|
||||
Reference in New Issue
Block a user