Remove JetScopeAdapter
This commit is contained in:
+10
-2
@@ -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() {
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-2013 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.annotations.NotNull;
|
||||
|
||||
public class JetScopeAdapter extends AbstractScopeAdapter {
|
||||
@NotNull
|
||||
private final JetScope workerScope;
|
||||
|
||||
public JetScopeAdapter(@NotNull JetScope workerScope) {
|
||||
this.workerScope = workerScope;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
protected final JetScope getWorkerScope() {
|
||||
return workerScope;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user