Provide location parameter in delegations

This commit is contained in:
Zalim Bashorov
2015-07-17 15:06:40 +03:00
parent 41449c107e
commit df4f43267b
10 changed files with 27 additions and 27 deletions
@@ -72,8 +72,8 @@ public class LazyPackageFragmentScopeForJavaPackage(
override fun getClassifier(name: Name, location: UsageLocation): ClassifierDescriptor? = classes(name)
override fun getProperties(name: Name, location: UsageLocation) = deserializedPackageScope().getProperties(name)
override fun getFunctions(name: Name, location: UsageLocation) = deserializedPackageScope().getFunctions(name) + super.getFunctions(name)
override fun getProperties(name: Name, location: UsageLocation) = deserializedPackageScope().getProperties(name, location)
override fun getFunctions(name: Name, location: UsageLocation) = deserializedPackageScope().getFunctions(name, location) + super.getFunctions(name, location)
override fun addExtraDescriptors(result: MutableSet<DeclarationDescriptor>,
kindFilter: DescriptorKindFilter,
@@ -32,7 +32,7 @@ public abstract class AbstractScopeAdapter : JetScope {
}
override fun getFunctions(name: Name, location: UsageLocation): Collection<FunctionDescriptor> {
return workerScope.getFunctions(name)
return workerScope.getFunctions(name, location)
}
override fun getPackage(name: Name): PackageViewDescriptor? {
@@ -40,11 +40,11 @@ public abstract class AbstractScopeAdapter : JetScope {
}
override fun getClassifier(name: Name, location: UsageLocation): ClassifierDescriptor? {
return workerScope.getClassifier(name)
return workerScope.getClassifier(name, location)
}
override fun getProperties(name: Name, location: UsageLocation): Collection<VariableDescriptor> {
return workerScope.getProperties(name)
return workerScope.getProperties(name, location)
}
override fun getSyntheticExtensionProperties(receiverTypes: Collection<JetType>, name: Name): Collection<PropertyDescriptor> {
@@ -51,19 +51,19 @@ public open class ChainedScope(
}
override fun getClassifier(name: Name, location: UsageLocation): ClassifierDescriptor?
= getFirstMatch { it.getClassifier(name) }
= getFirstMatch { it.getClassifier(name, location) }
override fun getPackage(name: Name): PackageViewDescriptor?
= getFirstMatch { it.getPackage(name) }
override fun getProperties(name: Name, location: UsageLocation): Collection<VariableDescriptor>
= getFromAllScopes { it.getProperties(name) }
= getFromAllScopes { it.getProperties(name, location) }
override fun getLocalVariable(name: Name): VariableDescriptor?
= getFirstMatch { it.getLocalVariable(name) }
override fun getFunctions(name: Name, location: UsageLocation): Collection<FunctionDescriptor>
= getFromAllScopes { it.getFunctions(name) }
= getFromAllScopes { it.getFunctions(name, location) }
override fun getSyntheticExtensionProperties(receiverTypes: Collection<JetType>, name: Name): Collection<PropertyDescriptor>
= getFromAllScopes { it.getSyntheticExtensionProperties(receiverTypes, name) }
@@ -24,7 +24,7 @@ import org.jetbrains.kotlin.utils.Printer
public class FilteringScope(private val workerScope: JetScope, private val predicate: (DeclarationDescriptor) -> Boolean) : JetScope {
override fun getFunctions(name: Name, location: UsageLocation) = workerScope.getFunctions(name).filter(predicate)
override fun getFunctions(name: Name, location: UsageLocation) = workerScope.getFunctions(name, location).filter(predicate)
override fun getContainingDeclaration() = workerScope.getContainingDeclaration()
@@ -33,9 +33,9 @@ public class FilteringScope(private val workerScope: JetScope, private val predi
override fun getPackage(name: Name) = filterDescriptor(workerScope.getPackage(name))
override fun getClassifier(name: Name, location: UsageLocation) = filterDescriptor(workerScope.getClassifier(name))
override fun getClassifier(name: Name, location: UsageLocation) = filterDescriptor(workerScope.getClassifier(name, location))
override fun getProperties(name: Name, location: UsageLocation) = workerScope.getProperties(name).filter(predicate)
override fun getProperties(name: Name, location: UsageLocation) = workerScope.getProperties(name, location).filter(predicate)
override fun getSyntheticExtensionProperties(receiverTypes: Collection<JetType>, name: Name): Collection<PropertyDescriptor> = workerScope.getSyntheticExtensionProperties(receiverTypes, name).filter(predicate)
@@ -21,7 +21,7 @@ import org.jetbrains.kotlin.descriptors.ReceiverParameterDescriptor
import org.jetbrains.kotlin.name.Name
public class InnerClassesScopeWrapper(override val workerScope: JetScope) : AbstractScopeAdapter() {
override fun getClassifier(name: Name, location: UsageLocation) = workerScope.getClassifier(name) as? ClassDescriptor
override fun getClassifier(name: Name, location: UsageLocation) = workerScope.getClassifier(name, location) as? ClassDescriptor
override fun getDeclarationsByLabel(labelName: Name) = workerScope.getDeclarationsByLabel(labelName).filterIsInstance<ClassDescriptor>()
@@ -61,13 +61,13 @@ public class SubstitutingScope(private val workerScope: JetScope, private val su
return result
}
override fun getProperties(name: Name, location: UsageLocation) = substitute(workerScope.getProperties(name))
override fun getProperties(name: Name, location: UsageLocation) = substitute(workerScope.getProperties(name, location))
override fun getLocalVariable(name: Name) = substitute(workerScope.getLocalVariable(name))
override fun getClassifier(name: Name, location: UsageLocation) = substitute(workerScope.getClassifier(name))
override fun getClassifier(name: Name, location: UsageLocation) = substitute(workerScope.getClassifier(name, location))
override fun getFunctions(name: Name, location: UsageLocation) = substitute(workerScope.getFunctions(name))
override fun getFunctions(name: Name, location: UsageLocation) = substitute(workerScope.getFunctions(name, location))
override fun getSyntheticExtensionProperties(receiverTypes: Collection<JetType>, name: Name): Collection<PropertyDescriptor> = substitute(workerScope.getSyntheticExtensionProperties(receiverTypes, name))