mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
resolve package/class if field is not accessible in fqn method call (IDEA-133812)
This commit is contained in:
+1
-1
@@ -240,7 +240,7 @@ public class PsiReferenceExpressionImpl extends PsiReferenceExpressionBase imple
|
||||
private JavaResolveResult[] resolve(IElementType parentType, @NotNull PsiFile containingFile) {
|
||||
if (parentType == JavaElementType.REFERENCE_EXPRESSION) {
|
||||
JavaResolveResult[] result = resolveToVariable(containingFile);
|
||||
if (result.length > 0) {
|
||||
if (result.length == 1 && result[0].isAccessible()) {
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
class C {
|
||||
private int id;
|
||||
}
|
||||
|
||||
class A extends C {
|
||||
{
|
||||
<error descr="Cannot resolve symbol 'id'">id</error>.MyObject.fromInt(1);
|
||||
|
||||
<error descr="'id' has private access in 'C'">id</error>.MyObject o;
|
||||
}
|
||||
}
|
||||
@@ -391,6 +391,7 @@ public class LightAdvHighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
public void testIDEA18343() { doTest(false, false); }
|
||||
public void testNewExpressionClass() { doTest(false, false); }
|
||||
public void testInnerClassObjectLiteralFromSuperExpression() { doTest(false, false); }
|
||||
public void testPrivateFieldInSuperClass() { doTest(false, false); }
|
||||
|
||||
public void testNoEnclosingInstanceWhenStaticNestedInheritsFromContainingClass() throws Exception {
|
||||
doTest(false, false);
|
||||
|
||||
Reference in New Issue
Block a user