One more simplification
This commit is contained in:
@@ -39,7 +39,7 @@ public class WritableScopeImpl(override val workerScope: JetScope,
|
|||||||
: AbstractScopeAdapter(), WritableScope {
|
: AbstractScopeAdapter(), WritableScope {
|
||||||
|
|
||||||
private val explicitlyAddedDescriptors = SmartList<DeclarationDescriptor>()
|
private val explicitlyAddedDescriptors = SmartList<DeclarationDescriptor>()
|
||||||
private val declaredDescriptorsAccessibleBySimpleName = HashMultimap.create<Name, DeclarationDescriptor>()
|
private val ownDeclaredDescriptors = ArrayList<DeclarationDescriptor>()
|
||||||
|
|
||||||
private var functionGroups: SetMultimap<Name, FunctionDescriptor>? = null
|
private var functionGroups: SetMultimap<Name, FunctionDescriptor>? = null
|
||||||
|
|
||||||
@@ -122,7 +122,7 @@ public class WritableScopeImpl(override val workerScope: JetScope,
|
|||||||
variableOrClassDescriptors!!.put(name, descriptor)
|
variableOrClassDescriptors!!.put(name, descriptor)
|
||||||
|
|
||||||
explicitlyAddedDescriptors.add(descriptor)
|
explicitlyAddedDescriptors.add(descriptor)
|
||||||
declaredDescriptorsAccessibleBySimpleName.put(name, descriptor)
|
ownDeclaredDescriptors.add(descriptor)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun addVariableDescriptor(variableDescriptor: VariableDescriptor) {
|
override fun addVariableDescriptor(variableDescriptor: VariableDescriptor) {
|
||||||
@@ -206,8 +206,7 @@ public class WritableScopeImpl(override val workerScope: JetScope,
|
|||||||
super<AbstractScopeAdapter>.getImplicitReceiversHierarchy()
|
super<AbstractScopeAdapter>.getImplicitReceiversHierarchy()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getOwnDeclaredDescriptors(): Collection<DeclarationDescriptor>
|
override fun getOwnDeclaredDescriptors(): Collection<DeclarationDescriptor> = ownDeclaredDescriptors
|
||||||
= declaredDescriptorsAccessibleBySimpleName.values()
|
|
||||||
|
|
||||||
override fun toString(): String {
|
override fun toString(): String {
|
||||||
return javaClass.getSimpleName() + "@" + Integer.toHexString(System.identityHashCode(this)) + " " + debugName + " for " + getContainingDeclaration()
|
return javaClass.getSimpleName() + "@" + Integer.toHexString(System.identityHashCode(this)) + " " + debugName + " for " + getContainingDeclaration()
|
||||||
|
|||||||
Reference in New Issue
Block a user