Delete JetScope.getObjectDescriptor()
This commit is contained in:
-12
@@ -432,18 +432,6 @@ public class DeserializedClassDescriptor extends AbstractClassDescriptor impleme
|
|||||||
protected void addAllClassDescriptors(@NotNull Collection<DeclarationDescriptor> result) {
|
protected void addAllClassDescriptors(@NotNull Collection<DeclarationDescriptor> result) {
|
||||||
result.addAll(classDescriptor.nestedClasses.getAllDescriptors());
|
result.addAll(classDescriptor.nestedClasses.getAllDescriptors());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
|
||||||
@Override
|
|
||||||
public ClassDescriptor getObjectDescriptor(@NotNull Name name) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@NotNull
|
|
||||||
@Override
|
|
||||||
protected Collection<ClassDescriptor> computeAllObjectDescriptors() {
|
|
||||||
return Collections.emptySet();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private class NestedClassDescriptors {
|
private class NestedClassDescriptors {
|
||||||
|
|||||||
-14
@@ -59,7 +59,6 @@ public abstract class DeserializedMemberScope implements JetScope {
|
|||||||
private final MemoizedFunctionToNotNull<Name, Collection<FunctionDescriptor>> functions;
|
private final MemoizedFunctionToNotNull<Name, Collection<FunctionDescriptor>> functions;
|
||||||
private final MemoizedFunctionToNotNull<Name, Collection<VariableDescriptor>> properties;
|
private final MemoizedFunctionToNotNull<Name, Collection<VariableDescriptor>> properties;
|
||||||
private final NotNullLazyValue<Collection<DeclarationDescriptor>> allDescriptors;
|
private final NotNullLazyValue<Collection<DeclarationDescriptor>> allDescriptors;
|
||||||
private final NotNullLazyValue<Collection<ClassDescriptor>> objectDescriptors;
|
|
||||||
|
|
||||||
public DeserializedMemberScope(
|
public DeserializedMemberScope(
|
||||||
@NotNull StorageManager storageManager,
|
@NotNull StorageManager storageManager,
|
||||||
@@ -89,12 +88,6 @@ public abstract class DeserializedMemberScope implements JetScope {
|
|||||||
return computeAllDescriptors();
|
return computeAllDescriptors();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.objectDescriptors = storageManager.createLazyValue(new Function0<Collection<ClassDescriptor>>() {
|
|
||||||
@Override
|
|
||||||
public Collection<ClassDescriptor> invoke() {
|
|
||||||
return computeAllObjectDescriptors();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@@ -172,13 +165,6 @@ public abstract class DeserializedMemberScope implements JetScope {
|
|||||||
|
|
||||||
protected abstract void addAllClassDescriptors(@NotNull Collection<DeclarationDescriptor> result);
|
protected abstract void addAllClassDescriptors(@NotNull Collection<DeclarationDescriptor> result);
|
||||||
|
|
||||||
@Nullable
|
|
||||||
@Override
|
|
||||||
public abstract ClassDescriptor getObjectDescriptor(@NotNull Name name);
|
|
||||||
|
|
||||||
@NotNull
|
|
||||||
protected abstract Collection<ClassDescriptor> computeAllObjectDescriptors();
|
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
@Override
|
@Override
|
||||||
public NamespaceDescriptor getNamespace(@NotNull Name name) {
|
public NamespaceDescriptor getNamespace(@NotNull Name name) {
|
||||||
|
|||||||
+6
-21
@@ -19,7 +19,10 @@ package org.jetbrains.jet.descriptors.serialization.descriptors;
|
|||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
import org.jetbrains.jet.descriptors.serialization.*;
|
import org.jetbrains.jet.descriptors.serialization.*;
|
||||||
import org.jetbrains.jet.lang.descriptors.*;
|
import org.jetbrains.jet.lang.descriptors.ClassDescriptor;
|
||||||
|
import org.jetbrains.jet.lang.descriptors.DeclarationDescriptor;
|
||||||
|
import org.jetbrains.jet.lang.descriptors.NamespaceDescriptor;
|
||||||
|
import org.jetbrains.jet.lang.descriptors.ReceiverParameterDescriptor;
|
||||||
import org.jetbrains.jet.lang.resolve.DescriptorUtils;
|
import org.jetbrains.jet.lang.resolve.DescriptorUtils;
|
||||||
import org.jetbrains.jet.lang.resolve.name.FqName;
|
import org.jetbrains.jet.lang.resolve.name.FqName;
|
||||||
import org.jetbrains.jet.lang.resolve.name.FqNameUnsafe;
|
import org.jetbrains.jet.lang.resolve.name.FqNameUnsafe;
|
||||||
@@ -27,7 +30,6 @@ import org.jetbrains.jet.lang.resolve.name.Name;
|
|||||||
import org.jetbrains.jet.storage.StorageManager;
|
import org.jetbrains.jet.storage.StorageManager;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
|
||||||
|
|
||||||
public class DeserializedPackageMemberScope extends DeserializedMemberScope {
|
public class DeserializedPackageMemberScope extends DeserializedMemberScope {
|
||||||
private final DescriptorFinder descriptorFinder;
|
private final DescriptorFinder descriptorFinder;
|
||||||
@@ -62,25 +64,14 @@ public class DeserializedPackageMemberScope extends DeserializedMemberScope {
|
|||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
@Override
|
@Override
|
||||||
protected ClassifierDescriptor getClassDescriptor(@NotNull Name name) {
|
protected ClassDescriptor getClassDescriptor(@NotNull Name name) {
|
||||||
return findClassDescriptor(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Nullable
|
|
||||||
@Override
|
|
||||||
public ClassDescriptor getObjectDescriptor(@NotNull Name name) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Nullable
|
|
||||||
private ClassDescriptor findClassDescriptor(Name name) {
|
|
||||||
return descriptorFinder.findClass(new ClassId(packageFqName, FqNameUnsafe.topLevel(name)));
|
return descriptorFinder.findClass(new ClassId(packageFqName, FqNameUnsafe.topLevel(name)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void addAllClassDescriptors(@NotNull Collection<DeclarationDescriptor> result) {
|
protected void addAllClassDescriptors(@NotNull Collection<DeclarationDescriptor> result) {
|
||||||
for (Name className : descriptorFinder.getClassNames(packageFqName)) {
|
for (Name className : descriptorFinder.getClassNames(packageFqName)) {
|
||||||
ClassDescriptor classDescriptor = findClassDescriptor(className);
|
ClassDescriptor classDescriptor = getClassDescriptor(className);
|
||||||
|
|
||||||
if (classDescriptor != null) {
|
if (classDescriptor != null) {
|
||||||
result.add(classDescriptor);
|
result.add(classDescriptor);
|
||||||
@@ -88,12 +79,6 @@ public class DeserializedPackageMemberScope extends DeserializedMemberScope {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
|
||||||
@Override
|
|
||||||
protected Collection<ClassDescriptor> computeAllObjectDescriptors() {
|
|
||||||
return Collections.emptySet();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void addNonDeclaredDescriptors(@NotNull Collection<DeclarationDescriptor> result) {
|
protected void addNonDeclaredDescriptors(@NotNull Collection<DeclarationDescriptor> result) {
|
||||||
// Do nothing
|
// Do nothing
|
||||||
|
|||||||
+1
-7
@@ -268,13 +268,7 @@ public class QualifiedExpressionResolver {
|
|||||||
descriptors.add(classifierDescriptor);
|
descriptors.add(classifierDescriptor);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lookupMode == LookupMode.ONLY_CLASSES) {
|
if (lookupMode == LookupMode.EVERYTHING) {
|
||||||
ClassDescriptor objectDescriptor = outerScope.getObjectDescriptor(referencedName);
|
|
||||||
if (objectDescriptor != null) {
|
|
||||||
descriptors.add(objectDescriptor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
descriptors.addAll(outerScope.getFunctions(referencedName));
|
descriptors.addAll(outerScope.getFunctions(referencedName));
|
||||||
descriptors.addAll(outerScope.getProperties(referencedName));
|
descriptors.addAll(outerScope.getProperties(referencedName));
|
||||||
|
|
||||||
|
|||||||
@@ -244,12 +244,6 @@ public class LazyImportScope implements JetScope {
|
|||||||
return selectFirstFromImports(name, LookupMode.ONLY_CLASSES, JetScopeSelectorUtil.CLASSIFIER_DESCRIPTOR_SCOPE_SELECTOR);
|
return selectFirstFromImports(name, LookupMode.ONLY_CLASSES, JetScopeSelectorUtil.CLASSIFIER_DESCRIPTOR_SCOPE_SELECTOR);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
|
||||||
@Override
|
|
||||||
public ClassDescriptor getObjectDescriptor(@NotNull Name name) {
|
|
||||||
return selectFirstFromImports(name, LookupMode.ONLY_CLASSES, JetScopeSelectorUtil.NAMED_OBJECT_SCOPE_SELECTOR);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
@Override
|
@Override
|
||||||
public NamespaceDescriptor getNamespace(@NotNull Name name) {
|
public NamespaceDescriptor getNamespace(@NotNull Name name) {
|
||||||
|
|||||||
@@ -180,11 +180,6 @@ public class ResolveSession implements KotlinCodeAnalyzer {
|
|||||||
resolutionScope.getClassifier(name);
|
resolutionScope.getClassifier(name);
|
||||||
DeclarationDescriptor declaration = getBindingContext().get(BindingContext.DECLARATION_TO_DESCRIPTOR, classOrObject);
|
DeclarationDescriptor declaration = getBindingContext().get(BindingContext.DECLARATION_TO_DESCRIPTOR, classOrObject);
|
||||||
|
|
||||||
if (declaration == null) {
|
|
||||||
// Why not use the result here. See the comment
|
|
||||||
resolutionScope.getObjectDescriptor(name);
|
|
||||||
declaration = getBindingContext().get(BindingContext.DECLARATION_TO_DESCRIPTOR, classOrObject);
|
|
||||||
}
|
|
||||||
if (declaration == null) {
|
if (declaration == null) {
|
||||||
throw new IllegalArgumentException("Could not find a classifier for " + classOrObject + " " + classOrObject.getText());
|
throw new IllegalArgumentException("Could not find a classifier for " + classOrObject + " " + classOrObject.getText());
|
||||||
}
|
}
|
||||||
|
|||||||
-5
@@ -108,11 +108,6 @@ public abstract class AbstractLazyMemberScope<D extends DeclarationDescriptor, D
|
|||||||
return first(classDescriptors.invoke(name));
|
return first(classDescriptors.invoke(name));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public ClassDescriptor getObjectDescriptor(@NotNull Name name) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static <T> T first(@NotNull List<T> list) {
|
private static <T> T first(@NotNull List<T> list) {
|
||||||
if (list.isEmpty()) return null;
|
if (list.isEmpty()) return null;
|
||||||
return list.get(0);
|
return list.get(0);
|
||||||
|
|||||||
@@ -75,15 +75,6 @@ public class JetScopeSelectorUtil {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
public static final ScopeByNameSelector<ClassDescriptor> NAMED_OBJECT_SCOPE_SELECTOR =
|
|
||||||
new ScopeByNameSelector<ClassDescriptor>() {
|
|
||||||
@Nullable
|
|
||||||
@Override
|
|
||||||
public ClassDescriptor get(@NotNull JetScope scope, @NotNull Name name) {
|
|
||||||
return scope.getObjectDescriptor(name);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
public static final ScopeByNameSelector<NamespaceDescriptor> NAMESPACE_SCOPE_SELECTOR =
|
public static final ScopeByNameSelector<NamespaceDescriptor> NAMESPACE_SCOPE_SELECTOR =
|
||||||
new ScopeByNameSelector<NamespaceDescriptor>() {
|
new ScopeByNameSelector<NamespaceDescriptor>() {
|
||||||
@Nullable
|
@Nullable
|
||||||
|
|||||||
@@ -126,19 +126,6 @@ public class WriteThroughScope extends WritableScopeWithImports {
|
|||||||
return super.getClassifier(name); // Imports
|
return super.getClassifier(name); // Imports
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public ClassDescriptor getObjectDescriptor(@NotNull Name name) {
|
|
||||||
checkMayRead();
|
|
||||||
|
|
||||||
ClassDescriptor objectDescriptor = writableWorker.getObjectDescriptor(name);
|
|
||||||
if (objectDescriptor != null) return objectDescriptor;
|
|
||||||
|
|
||||||
objectDescriptor = getWorkerScope().getObjectDescriptor(name);
|
|
||||||
if (objectDescriptor != null) return objectDescriptor;
|
|
||||||
|
|
||||||
return super.getObjectDescriptor(name); // Imports
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addLabeledDeclaration(@NotNull DeclarationDescriptor descriptor) {
|
public void addLabeledDeclaration(@NotNull DeclarationDescriptor descriptor) {
|
||||||
checkMayWrite();
|
checkMayWrite();
|
||||||
@@ -261,13 +248,6 @@ public class WriteThroughScope extends WritableScopeWithImports {
|
|||||||
return allDescriptors;
|
return allDescriptors;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
|
||||||
public JetScope getOuterScope() {
|
|
||||||
checkMayRead();
|
|
||||||
|
|
||||||
return getWorkerScope();
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestOnly
|
@TestOnly
|
||||||
@Override
|
@Override
|
||||||
protected void printAdditionalScopeStructure(@NotNull Printer p) {
|
protected void printAdditionalScopeStructure(@NotNull Printer p) {
|
||||||
|
|||||||
-5
@@ -52,11 +52,6 @@ public abstract class JavaClassMembersScope extends JavaBaseScope {
|
|||||||
return memberResolver.resolveFunctionGroupForClass(members, descriptor);
|
return memberResolver.resolveFunctionGroupForClass(members, descriptor);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public ClassDescriptor getObjectDescriptor(@NotNull Name name) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ClassifierDescriptor getClassifier(@NotNull Name name) {
|
public ClassifierDescriptor getClassifier(@NotNull Name name) {
|
||||||
if (innerClassesMap == null) {
|
if (innerClassesMap == null) {
|
||||||
|
|||||||
-9
@@ -58,15 +58,6 @@ public final class JavaPackageScope extends JavaBaseScope {
|
|||||||
return memberResolver.resolveClass(packageFQN.child(name), IGNORE_KOTLIN_SOURCES);
|
return memberResolver.resolveClass(packageFQN.child(name), IGNORE_KOTLIN_SOURCES);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public ClassDescriptor getObjectDescriptor(@NotNull Name name) {
|
|
||||||
ClassDescriptor classDescriptor = memberResolver.resolveClass(packageFQN.child(name), IGNORE_KOTLIN_SOURCES);
|
|
||||||
if (classDescriptor != null && classDescriptor.getKind().isSingleton()) {
|
|
||||||
return classDescriptor;
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public NamespaceDescriptor getNamespace(@NotNull Name name) {
|
public NamespaceDescriptor getNamespace(@NotNull Name name) {
|
||||||
return memberResolver.resolveNamespace(packageFQN.child(name), INCLUDE_KOTLIN_SOURCES);
|
return memberResolver.resolveNamespace(packageFQN.child(name), INCLUDE_KOTLIN_SOURCES);
|
||||||
|
|||||||
@@ -55,11 +55,6 @@ public abstract class AbstractScopeAdapter implements JetScope {
|
|||||||
return getWorkerScope().getClassifier(name);
|
return getWorkerScope().getClassifier(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public ClassDescriptor getObjectDescriptor(@NotNull Name name) {
|
|
||||||
return getWorkerScope().getObjectDescriptor(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Collection<VariableDescriptor> getProperties(@NotNull Name name) {
|
public Collection<VariableDescriptor> getProperties(@NotNull Name name) {
|
||||||
|
|||||||
@@ -57,15 +57,6 @@ public class ChainedScope implements JetScope {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public ClassDescriptor getObjectDescriptor(@NotNull Name name) {
|
|
||||||
for (JetScope scope : scopeChain) {
|
|
||||||
ClassDescriptor objectDescriptor = scope.getObjectDescriptor(name);
|
|
||||||
if (objectDescriptor != null) return objectDescriptor;
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public NamespaceDescriptor getNamespace(@NotNull Name name) {
|
public NamespaceDescriptor getNamespace(@NotNull Name name) {
|
||||||
for (JetScope jetScope : scopeChain) {
|
for (JetScope jetScope : scopeChain) {
|
||||||
|
|||||||
@@ -65,11 +65,6 @@ public class FilteringScope implements JetScope {
|
|||||||
return filterDescriptor(workerScope.getClassifier(name));
|
return filterDescriptor(workerScope.getClassifier(name));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public ClassDescriptor getObjectDescriptor(@NotNull Name name) {
|
|
||||||
return filterDescriptor(workerScope.getObjectDescriptor(name));
|
|
||||||
}
|
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Collection<VariableDescriptor> getProperties(@NotNull Name name) {
|
public Collection<VariableDescriptor> getProperties(@NotNull Name name) {
|
||||||
|
|||||||
@@ -52,9 +52,6 @@ public interface JetScope {
|
|||||||
*/
|
*/
|
||||||
@Nullable
|
@Nullable
|
||||||
ClassifierDescriptor getClassifier(@NotNull Name name);
|
ClassifierDescriptor getClassifier(@NotNull Name name);
|
||||||
|
|
||||||
@Nullable
|
|
||||||
ClassDescriptor getObjectDescriptor(@NotNull Name name);
|
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
NamespaceDescriptor getNamespace(@NotNull Name name);
|
NamespaceDescriptor getNamespace(@NotNull Name name);
|
||||||
|
|||||||
@@ -33,11 +33,6 @@ public abstract class JetScopeImpl implements JetScope {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public ClassDescriptor getObjectDescriptor(@NotNull Name name) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Collection<VariableDescriptor> getProperties(@NotNull Name name) {
|
public Collection<VariableDescriptor> getProperties(@NotNull Name name) {
|
||||||
|
|||||||
@@ -98,11 +98,6 @@ public class SubstitutingScope implements JetScope {
|
|||||||
return substitute(workerScope.getClassifier(name));
|
return substitute(workerScope.getClassifier(name));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public ClassDescriptor getObjectDescriptor(@NotNull Name name) {
|
|
||||||
return substitute(workerScope.getObjectDescriptor(name));
|
|
||||||
}
|
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Collection<FunctionDescriptor> getFunctions(@NotNull Name name) {
|
public Collection<FunctionDescriptor> getFunctions(@NotNull Name name) {
|
||||||
|
|||||||
@@ -35,8 +35,6 @@ public class WritableScopeImpl extends WritableScopeWithImports {
|
|||||||
private final Multimap<Name, DeclarationDescriptor> declaredDescriptorsAccessibleBySimpleName = HashMultimap.create();
|
private final Multimap<Name, DeclarationDescriptor> declaredDescriptorsAccessibleBySimpleName = HashMultimap.create();
|
||||||
private boolean allDescriptorsDone = false;
|
private boolean allDescriptorsDone = false;
|
||||||
|
|
||||||
private Set<ClassDescriptor> allObjectDescriptors = null;
|
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
private final DeclarationDescriptor ownerDeclarationDescriptor;
|
private final DeclarationDescriptor ownerDeclarationDescriptor;
|
||||||
|
|
||||||
@@ -54,9 +52,6 @@ public class WritableScopeImpl extends WritableScopeWithImports {
|
|||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
private Map<LabelName, List<DeclarationDescriptor>> labelsToDescriptors;
|
private Map<LabelName, List<DeclarationDescriptor>> labelsToDescriptors;
|
||||||
|
|
||||||
@Nullable
|
|
||||||
private Map<Name, ClassDescriptor> objectDescriptors;
|
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
private ReceiverParameterDescriptor implicitReceiver;
|
private ReceiverParameterDescriptor implicitReceiver;
|
||||||
@@ -146,14 +141,6 @@ public class WritableScopeImpl extends WritableScopeWithImports {
|
|||||||
return labelsToDescriptors;
|
return labelsToDescriptors;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
|
||||||
private Map<Name, ClassDescriptor> getObjectDescriptorsMap() {
|
|
||||||
if (objectDescriptors == null) {
|
|
||||||
objectDescriptors = Maps.newHashMap();
|
|
||||||
}
|
|
||||||
return objectDescriptors;
|
|
||||||
}
|
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Collection<DeclarationDescriptor> getDeclarationsByLabel(@NotNull LabelName labelName) {
|
public Collection<DeclarationDescriptor> getDeclarationsByLabel(@NotNull LabelName labelName) {
|
||||||
@@ -384,17 +371,6 @@ public class WritableScopeImpl extends WritableScopeWithImports {
|
|||||||
return super.getClassifier(name);
|
return super.getClassifier(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public ClassDescriptor getObjectDescriptor(@NotNull Name name) {
|
|
||||||
ClassDescriptor descriptor = getObjectDescriptorsMap().get(name);
|
|
||||||
if (descriptor != null) return descriptor;
|
|
||||||
|
|
||||||
ClassDescriptor fromWorker = getWorkerScope().getObjectDescriptor(name);
|
|
||||||
if (fromWorker != null) return fromWorker;
|
|
||||||
|
|
||||||
return super.getObjectDescriptor(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addNamespace(@NotNull NamespaceDescriptor namespaceDescriptor) {
|
public void addNamespace(@NotNull NamespaceDescriptor namespaceDescriptor) {
|
||||||
checkMayWrite();
|
checkMayWrite();
|
||||||
|
|||||||
-13
@@ -176,19 +176,6 @@ public abstract class WritableScopeWithImports extends JetScopeAdapter implement
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public ClassDescriptor getObjectDescriptor(@NotNull Name name) {
|
|
||||||
checkMayRead();
|
|
||||||
|
|
||||||
for (JetScope imported : getImports()) {
|
|
||||||
ClassDescriptor objectDescriptor = imported.getObjectDescriptor(name);
|
|
||||||
if (objectDescriptor != null) {
|
|
||||||
return objectDescriptor;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public NamespaceDescriptor getNamespace(@NotNull Name name) {
|
public NamespaceDescriptor getNamespace(@NotNull Name name) {
|
||||||
checkMayRead();
|
checkMayRead();
|
||||||
|
|||||||
@@ -88,11 +88,6 @@ public class ErrorUtils {
|
|||||||
return ERROR_CLASS;
|
return ERROR_CLASS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public ClassDescriptor getObjectDescriptor(@NotNull Name name) {
|
|
||||||
return ERROR_CLASS;
|
|
||||||
}
|
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<VariableDescriptor> getProperties(@NotNull Name name) {
|
public Set<VariableDescriptor> getProperties(@NotNull Name name) {
|
||||||
@@ -169,12 +164,6 @@ public class ErrorUtils {
|
|||||||
throw new IllegalStateException();
|
throw new IllegalStateException();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
|
||||||
@Override
|
|
||||||
public ClassDescriptor getObjectDescriptor(@NotNull Name name) {
|
|
||||||
throw new IllegalStateException();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
@Override
|
@Override
|
||||||
public NamespaceDescriptor getNamespace(@NotNull Name name) {
|
public NamespaceDescriptor getNamespace(@NotNull Name name) {
|
||||||
|
|||||||
Reference in New Issue
Block a user