Update for the previous fix for class object's visibility.
This commit is contained in:
@@ -31,6 +31,7 @@ abstract class JetDeclarationImpl extends JetExpressionImpl implements JetDeclar
|
||||
super(node);
|
||||
}
|
||||
|
||||
//TODO: code duplication with JetDeclarationStub
|
||||
@Override
|
||||
@Nullable
|
||||
public JetModifierList getModifierList() {
|
||||
|
||||
@@ -17,9 +17,11 @@
|
||||
package org.jetbrains.jet.lang.psi;
|
||||
|
||||
import com.intellij.lang.ASTNode;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.stubs.IStubElementType;
|
||||
import com.intellij.psi.stubs.StubElement;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.jet.JetNodeTypes;
|
||||
import org.jetbrains.jet.lexer.JetToken;
|
||||
|
||||
@@ -35,11 +37,23 @@ abstract class JetDeclarationStub<T extends StubElement> extends JetElementImplS
|
||||
super(node);
|
||||
}
|
||||
|
||||
//TODO: code duplication with JetDeclarationImpl
|
||||
@Override
|
||||
@Nullable
|
||||
public JetModifierList getModifierList() {
|
||||
PsiElement parent = getParent();
|
||||
if (isClassObject(parent)) {
|
||||
assert parent instanceof JetDeclaration;
|
||||
return ((JetDeclaration)parent).getModifierList();
|
||||
}
|
||||
return (JetModifierList) findChildByType(JetNodeTypes.MODIFIER_LIST);
|
||||
}
|
||||
|
||||
|
||||
private static boolean isClassObject(@NotNull PsiElement parent) {
|
||||
return parent.getNode().getElementType().equals(JetNodeTypes.CLASS_OBJECT);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasModifier(JetToken modifier) {
|
||||
JetModifierList modifierList = getModifierList();
|
||||
|
||||
@@ -3,7 +3,7 @@ package foo
|
||||
fun test() {
|
||||
A.d
|
||||
A.<!INVISIBLE_MEMBER!>f<!>
|
||||
B.<!INVISIBLE_MEMBER!>c<!>
|
||||
CCC.<!INVISIBLE_MEMBER!>classObjectVar<!>
|
||||
}
|
||||
|
||||
class A() {
|
||||
@@ -15,8 +15,8 @@ class A() {
|
||||
}
|
||||
}
|
||||
|
||||
class B() {
|
||||
class CCC() {
|
||||
private class object {
|
||||
val c = 3
|
||||
val classObjectVar = 3
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user