Introduce ClassDescriptor#getStaticScope()
Will be used to exterminate hacks related to static Java methods in our codebase: synthetic class object for enum, synthetic package for static members of Java classes, etc.
This commit is contained in:
+8
-1
@@ -36,6 +36,7 @@ import org.jetbrains.jet.lang.resolve.DescriptorFactory;
|
||||
import org.jetbrains.jet.lang.resolve.OverridingUtil;
|
||||
import org.jetbrains.jet.lang.resolve.name.Name;
|
||||
import org.jetbrains.jet.lang.resolve.scopes.JetScope;
|
||||
import org.jetbrains.jet.lang.resolve.scopes.StaticScopeForKotlinClass;
|
||||
import org.jetbrains.jet.lang.types.AbstractClassTypeConstructor;
|
||||
import org.jetbrains.jet.lang.types.ErrorUtils;
|
||||
import org.jetbrains.jet.lang.types.JetType;
|
||||
@@ -61,8 +62,8 @@ public class DeserializedClassDescriptor extends AbstractClassDescriptor impleme
|
||||
private final NotNullLazyValue<Annotations> annotations;
|
||||
|
||||
private final NullableLazyValue<ClassDescriptor> classObjectDescriptor;
|
||||
|
||||
private final NestedClassDescriptors nestedClasses;
|
||||
private final JetScope staticScope = new StaticScopeForKotlinClass(this);
|
||||
|
||||
private final NotNullLazyValue<DeclarationDescriptor> containingDeclaration;
|
||||
private final DeserializedClassTypeConstructor typeConstructor;
|
||||
@@ -194,6 +195,12 @@ public class DeserializedClassDescriptor extends AbstractClassDescriptor impleme
|
||||
return memberScope;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public JetScope getStaticScope() {
|
||||
return staticScope;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private ConstructorDescriptor computePrimaryConstructor() {
|
||||
if (!classProto.hasPrimaryConstructor()) return null;
|
||||
|
||||
Reference in New Issue
Block a user