Interface ClassDescriptorWithResolutionScopes extracted for both lazy and mutable classes
This commit is contained in:
+31
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright 2010-2014 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.descriptors;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.jet.lang.resolve.scopes.JetScope;
|
||||
|
||||
public interface ClassDescriptorWithResolutionScopes extends ClassDescriptor {
|
||||
@NotNull
|
||||
JetScope getScopeForClassHeaderResolution();
|
||||
|
||||
@NotNull
|
||||
JetScope getScopeForMemberDeclarationResolution();
|
||||
|
||||
@NotNull
|
||||
JetScope getScopeForInitializerResolution();
|
||||
}
|
||||
+7
-4
@@ -27,7 +27,7 @@ import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
public class MutableClassDescriptor extends MutableClassDescriptorLite {
|
||||
public class MutableClassDescriptor extends MutableClassDescriptorLite implements ClassDescriptorWithResolutionScopes {
|
||||
private final Set<ConstructorDescriptor> constructors = Sets.newLinkedHashSet();
|
||||
private ConstructorDescriptor primaryConstructor;
|
||||
|
||||
@@ -137,13 +137,15 @@ public class MutableClassDescriptor extends MutableClassDescriptorLite {
|
||||
scopeForMemberResolution.setImplicitReceiver(getThisAsReceiverParameter());
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public JetScope getScopeForSupertypeResolution() {
|
||||
public JetScope getScopeForClassHeaderResolution() {
|
||||
return scopeForSupertypeResolution;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public JetScope getScopeForMemberResolution() {
|
||||
public JetScope getScopeForMemberDeclarationResolution() {
|
||||
return scopeForMemberResolution;
|
||||
}
|
||||
|
||||
@@ -154,8 +156,9 @@ public class MutableClassDescriptor extends MutableClassDescriptorLite {
|
||||
return scopeForInitializers;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public JetScope getScopeForInitializers() {
|
||||
public JetScope getScopeForInitializerResolution() {
|
||||
return getWritableScopeForInitializers();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user