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