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
@@ -26,11 +26,11 @@ import org.jetbrains.kotlin.types.KotlinType
interface SyntheticScope {
fun getSyntheticExtensionProperties(receiverTypes: Collection<KotlinType>, name: Name, location: LookupLocation): Collection<PropertyDescriptor>
fun getSyntheticMemberFunctions(receiverTypes: Collection<KotlinType>, name: Name, location: LookupLocation): Collection<FunctionDescriptor>
fun getSyntheticStaticFunctions(scope: ResolutionScope, name: Name, location: LookupLocation): Collection<FunctionDescriptor>
fun getSyntheticExtensionProperties(receiverTypes: Collection<KotlinType>): Collection<PropertyDescriptor>
fun getSyntheticMemberFunctions(receiverTypes: Collection<KotlinType>): Collection<FunctionDescriptor>
fun getSyntheticStaticFunctions(scope: ResolutionScope): Collection<FunctionDescriptor>
}
interface SyntheticScopes {
@@ -56,3 +56,6 @@ fun SyntheticScopes.collectSyntheticExtensionProperties(receiverTypes: Collectio
fun SyntheticScopes.collectSyntheticMemberFunctions(receiverTypes: Collection<KotlinType>)
= scopes.flatMap { it.getSyntheticMemberFunctions(receiverTypes) }
fun SyntheticScopes.collectSyntheticStaticFunctions(scope: ResolutionScope)
= scopes.flatMap { it.getSyntheticStaticFunctions(scope) }