Adapt changes in IDE after moving SAM adapters to synthetic scope

The main change is that now to get static sam adapters one should do it using synthetic scopes and static scope of container
This commit is contained in:
Mikhail Zarechenskiy
2017-05-02 15:03:17 +03:00
parent 8e233162ed
commit 429f0e4f68
8 changed files with 66 additions and 16 deletions
@@ -180,6 +180,9 @@ class JavaSyntheticPropertiesScope(storageManager: StorageManager, private val l
override fun getSyntheticStaticFunctions(scope: ResolutionScope, name: Name, location: LookupLocation): Collection<FunctionDescriptor>
= emptyList()
override fun getSyntheticStaticFunctions(scope: ResolutionScope): Collection<FunctionDescriptor>
= emptyList()
private fun collectSyntheticPropertiesByName(result: SmartList<PropertyDescriptor>?, type: TypeConstructor, name: Name, processedTypes: MutableSet<TypeConstructor>?, location: LookupLocation): SmartList<PropertyDescriptor>? {
if (processedTypes != null && !processedTypes.add(type)) return result
@@ -122,6 +122,10 @@ class SamAdapterFunctionsScope(
return scope.getContributedFunctions(name, location).mapNotNull { samAdapterForStaticFunction(it) }
}
override fun getSyntheticStaticFunctions(scope: ResolutionScope): Collection<FunctionDescriptor> {
return scope.getContributedDescriptors(DescriptorKindFilter.FUNCTIONS).mapNotNull { samAdapterForStaticFunction(it) }
}
private class MyFunctionDescriptor(
containingDeclaration: DeclarationDescriptor,
original: SimpleFunctionDescriptor?,