Revert "frontend: base class for JetScope implementations"
This reverts commit b33fc76c12.
This commit is contained in:
@@ -22,7 +22,6 @@ import org.jetbrains.jet.lang.resolve.name.LabelName;
|
||||
import org.jetbrains.jet.lang.resolve.name.Name;
|
||||
import org.jetbrains.jet.lang.resolve.scopes.DescriptorPredicate;
|
||||
import org.jetbrains.jet.lang.resolve.scopes.JetScope;
|
||||
import org.jetbrains.jet.lang.resolve.scopes.JetScopeBase;
|
||||
import org.jetbrains.jet.lang.resolve.scopes.receivers.ReceiverDescriptor;
|
||||
|
||||
import java.util.Collection;
|
||||
@@ -34,7 +33,7 @@ import java.util.Set;
|
||||
*
|
||||
* @author abreslav
|
||||
*/
|
||||
public abstract class AbstractScopeAdapter extends JetScopeBase {
|
||||
public abstract class AbstractScopeAdapter implements JetScope {
|
||||
@NotNull
|
||||
protected abstract JetScope getWorkerScope();
|
||||
|
||||
@@ -110,4 +109,8 @@ public abstract class AbstractScopeAdapter extends JetScopeBase {
|
||||
return getWorkerScope().getAllDescriptors(predicate);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<DeclarationDescriptor> getAllDescriptors() {
|
||||
return getAllDescriptors(DescriptorPredicate.all());
|
||||
}
|
||||
}
|
||||
|
||||
+6
-2
@@ -29,7 +29,6 @@ import org.jetbrains.jet.lang.resolve.name.Name;
|
||||
import org.jetbrains.jet.lang.resolve.scopes.DescriptorPredicate;
|
||||
import org.jetbrains.jet.lang.resolve.scopes.DescriptorPredicateUtils;
|
||||
import org.jetbrains.jet.lang.resolve.scopes.JetScope;
|
||||
import org.jetbrains.jet.lang.resolve.scopes.JetScopeBase;
|
||||
import org.jetbrains.jet.lang.resolve.scopes.receivers.ReceiverDescriptor;
|
||||
|
||||
import java.util.*;
|
||||
@@ -37,7 +36,7 @@ import java.util.*;
|
||||
/**
|
||||
* @author abreslav
|
||||
*/
|
||||
public abstract class AbstractLazyMemberScope<D extends DeclarationDescriptor, DP extends DeclarationProvider> extends JetScopeBase {
|
||||
public abstract class AbstractLazyMemberScope<D extends DeclarationDescriptor, DP extends DeclarationProvider> implements JetScope {
|
||||
protected final ResolveSession resolveSession;
|
||||
protected final DP declarationProvider;
|
||||
protected final D thisDescriptor;
|
||||
@@ -232,6 +231,11 @@ public abstract class AbstractLazyMemberScope<D extends DeclarationDescriptor, D
|
||||
return DescriptorPredicateUtils.filter(allDescriptors, predicate);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<DeclarationDescriptor> getAllDescriptors() {
|
||||
return getAllDescriptors(DescriptorPredicate.all());
|
||||
}
|
||||
|
||||
protected abstract void addExtraDescriptors();
|
||||
|
||||
@Override
|
||||
|
||||
@@ -31,7 +31,7 @@ import java.util.Set;
|
||||
/**
|
||||
* @author abreslav
|
||||
*/
|
||||
public class ChainedScope extends JetScopeBase {
|
||||
public class ChainedScope implements JetScope {
|
||||
private final DeclarationDescriptor containingDeclaration;
|
||||
private final JetScope[] scopeChain;
|
||||
private Collection<DeclarationDescriptor> allDescriptors;
|
||||
@@ -167,4 +167,8 @@ public class ChainedScope extends JetScopeBase {
|
||||
return allDescriptors;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<DeclarationDescriptor> getAllDescriptors() {
|
||||
return getAllDescriptors(DescriptorPredicate.all());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-2012 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.jet.lang.resolve.scopes;
|
||||
|
||||
import org.jetbrains.jet.lang.descriptors.DeclarationDescriptor;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* @author Stepan Koltsov
|
||||
*/
|
||||
public abstract class JetScopeBase implements JetScope {
|
||||
|
||||
@Override
|
||||
public Collection<DeclarationDescriptor> getAllDescriptors() {
|
||||
return getAllDescriptors(DescriptorPredicate.all());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -30,7 +30,7 @@ import java.util.Set;
|
||||
/**
|
||||
* @author abreslav
|
||||
*/
|
||||
public abstract class JetScopeImpl extends JetScopeBase {
|
||||
public abstract class JetScopeImpl implements JetScope {
|
||||
@Override
|
||||
public ClassifierDescriptor getClassifier(@NotNull Name name) {
|
||||
return null;
|
||||
@@ -92,6 +92,11 @@ public abstract class JetScopeImpl extends JetScopeBase {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<DeclarationDescriptor> getAllDescriptors() {
|
||||
return getAllDescriptors(DescriptorPredicate.all());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getImplicitReceiversHierarchy(@NotNull List<ReceiverDescriptor> result) {
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ import java.util.Set;
|
||||
/**
|
||||
* @author abreslav
|
||||
*/
|
||||
public class SubstitutingScope extends JetScopeBase {
|
||||
public class SubstitutingScope implements JetScope {
|
||||
|
||||
private final JetScope workerScope;
|
||||
private final TypeSubstitutor substitutor;
|
||||
@@ -163,4 +163,8 @@ public class SubstitutingScope extends JetScopeBase {
|
||||
return allDescriptors;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<DeclarationDescriptor> getAllDescriptors() {
|
||||
return getAllDescriptors(DescriptorPredicate.all());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,6 @@ import org.jetbrains.jet.lang.resolve.name.LabelName;
|
||||
import org.jetbrains.jet.lang.resolve.name.Name;
|
||||
import org.jetbrains.jet.lang.resolve.scopes.DescriptorPredicate;
|
||||
import org.jetbrains.jet.lang.resolve.scopes.JetScope;
|
||||
import org.jetbrains.jet.lang.resolve.scopes.JetScopeBase;
|
||||
import org.jetbrains.jet.lang.resolve.scopes.receivers.ReceiverDescriptor;
|
||||
import org.jetbrains.jet.lang.types.error.ErrorSimpleFunctionDescriptorImpl;
|
||||
import org.jetbrains.jet.lang.types.lang.JetStandardClasses;
|
||||
@@ -39,7 +38,7 @@ public class ErrorUtils {
|
||||
private static final ModuleDescriptor ERROR_MODULE = new ModuleDescriptor(Name.special("<ERROR MODULE>"));
|
||||
|
||||
|
||||
public static class ErrorScope extends JetScopeBase {
|
||||
public static class ErrorScope implements JetScope {
|
||||
|
||||
private final String debugMessage;
|
||||
|
||||
@@ -118,6 +117,10 @@ public class ErrorUtils {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<DeclarationDescriptor> getAllDescriptors() {
|
||||
return getAllDescriptors(DescriptorPredicate.all());
|
||||
}
|
||||
}
|
||||
|
||||
private static final ClassDescriptorImpl ERROR_CLASS = new ClassDescriptorImpl(ERROR_MODULE, Collections.<AnnotationDescriptor>emptyList(), Name.special("<ERROR CLASS>")) {
|
||||
|
||||
Reference in New Issue
Block a user