Remove JetScopeAdapter

This commit is contained in:
Alexander Udalov
2014-07-06 17:08:04 +04:00
parent 64512ae87b
commit e502d8dcc6
3 changed files with 17 additions and 37 deletions
@@ -27,7 +27,9 @@ import org.jetbrains.jet.utils.Printer;
import java.util.*;
public abstract class WritableScopeWithImports extends JetScopeAdapter implements WritableScope {
public abstract class WritableScopeWithImports extends AbstractScopeAdapter implements WritableScope {
@NotNull
private final JetScope workerScope;
@NotNull
private final String debugName;
@@ -39,7 +41,7 @@ public abstract class WritableScopeWithImports extends JetScopeAdapter implement
private List<ReceiverParameterDescriptor> implicitReceiverHierarchy;
public WritableScopeWithImports(@NotNull JetScope scope, @NotNull RedeclarationHandler redeclarationHandler, @NotNull String debugName) {
super(scope);
this.workerScope = scope;
this.redeclarationHandler = redeclarationHandler;
this.debugName = debugName;
}
@@ -78,6 +80,12 @@ public abstract class WritableScopeWithImports extends JetScopeAdapter implement
@NotNull
@Override
protected final JetScope getWorkerScope() {
return workerScope;
}
@NotNull
protected final List<JetScope> getImports() {
if (imports == null) {
@@ -547,7 +547,13 @@ public class JetTypeCheckerTest extends JetLiteFixture {
private void assertType(String contextType, final String expression, String expectedType) {
final JetType thisType = makeType(contextType);
JetScope scope = new JetScopeAdapter(scopeWithImports) {
JetScope scope = new AbstractScopeAdapter() {
@NotNull
@Override
protected JetScope getWorkerScope() {
return scopeWithImports;
}
@NotNull
@Override
public List<ReceiverParameterDescriptor> getImplicitReceiversHierarchy() {