From e8a697cb6d725870cfbb9f9b7a221948a45b25f7 Mon Sep 17 00:00:00 2001 From: Stanislav Erokhin Date: Thu, 17 Dec 2015 02:47:12 +0300 Subject: [PATCH] Removed methods about synthetic from ImportingScope. --- .../kotlin/cli/jvm/repl/di/injection.kt | 6 ++-- .../kotlin/frontend/java/di/injection.kt | 4 +-- ...tionalScopesWithJavaSyntheticExtensions.kt | 25 -------------- .../synthetic/JavaSyntheticPropertiesScope.kt | 17 +++++----- .../synthetic/SamAdapterFunctionsScope.kt | 14 ++++---- .../kotlin/resolve/lazy/FileScopeProvider.kt | 5 --- .../resolve/lazy/FileScopeProviderImpl.kt | 9 +---- .../kotlin/resolve/lazy/LazyImportScope.kt | 33 ------------------- .../jetbrains/kotlin/resolve/scopes/Scopes.kt | 30 +---------------- .../kotlin/resolve/scopes/utils/ScopeUtils.kt | 12 ------- .../ReplaceWithAnnotationAnalyzer.kt | 3 +- 11 files changed, 21 insertions(+), 137 deletions(-) delete mode 100644 compiler/frontend.java/src/org/jetbrains/kotlin/synthetic/AdditionalScopesWithJavaSyntheticExtensions.kt diff --git a/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/repl/di/injection.kt b/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/repl/di/injection.kt index 21f8bc5711c..82c908c2b52 100644 --- a/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/repl/di/injection.kt +++ b/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/repl/di/injection.kt @@ -35,7 +35,6 @@ import org.jetbrains.kotlin.resolve.QualifiedExpressionResolver import org.jetbrains.kotlin.resolve.jvm.JavaClassFinderPostConstruct import org.jetbrains.kotlin.resolve.jvm.JavaDescriptorResolver import org.jetbrains.kotlin.resolve.jvm.platform.JvmPlatform -import org.jetbrains.kotlin.resolve.lazy.FileScopeProvider import org.jetbrains.kotlin.resolve.lazy.FileScopeProviderImpl import org.jetbrains.kotlin.resolve.lazy.ResolveSession import org.jetbrains.kotlin.resolve.lazy.TopLevelDescriptorProvider @@ -54,9 +53,8 @@ class ReplFileScopeProvider( moduleDescriptor: ModuleDescriptor, qualifiedExpressionResolver: QualifiedExpressionResolver, bindingTrace: BindingTrace, - ktImportsFactory: KtImportsFactory, - additionalScopes: Iterable -) : FileScopeProviderImpl(topLevelDescriptorProvider, storageManager, moduleDescriptor, qualifiedExpressionResolver, bindingTrace, ktImportsFactory, additionalScopes) { + ktImportsFactory: KtImportsFactory +) : FileScopeProviderImpl(topLevelDescriptorProvider, storageManager, moduleDescriptor, qualifiedExpressionResolver, bindingTrace, ktImportsFactory) { override fun getFileResolutionScope(file: KtFile): LexicalScope = lastLineScopeProvider.lastLineScope ?: super.getFileResolutionScope(file) diff --git a/compiler/frontend.java/src/org/jetbrains/kotlin/frontend/java/di/injection.kt b/compiler/frontend.java/src/org/jetbrains/kotlin/frontend/java/di/injection.kt index 219205366f4..a61fa7062ed 100644 --- a/compiler/frontend.java/src/org/jetbrains/kotlin/frontend/java/di/injection.kt +++ b/compiler/frontend.java/src/org/jetbrains/kotlin/frontend/java/di/injection.kt @@ -21,13 +21,13 @@ import com.intellij.psi.search.GlobalSearchScope import org.jetbrains.kotlin.container.* import org.jetbrains.kotlin.context.LazyResolveToken import org.jetbrains.kotlin.context.ModuleContext +import org.jetbrains.kotlin.descriptors.PackagePartProvider import org.jetbrains.kotlin.frontend.di.configureModule import org.jetbrains.kotlin.incremental.components.LookupTracker import org.jetbrains.kotlin.load.java.JavaClassFinderImpl import org.jetbrains.kotlin.load.java.JavaFlexibleTypeCapabilitiesProvider import org.jetbrains.kotlin.load.java.components.* import org.jetbrains.kotlin.load.java.lazy.ModuleClassResolver -import org.jetbrains.kotlin.descriptors.PackagePartProvider import org.jetbrains.kotlin.load.java.lazy.SingleModuleClassResolver import org.jetbrains.kotlin.load.java.sam.SamConversionResolverImpl import org.jetbrains.kotlin.load.java.structure.impl.JavaPropertyInitializerEvaluatorImpl @@ -41,7 +41,6 @@ import org.jetbrains.kotlin.resolve.jvm.platform.JvmPlatform import org.jetbrains.kotlin.resolve.lazy.FileScopeProviderImpl import org.jetbrains.kotlin.resolve.lazy.ResolveSession import org.jetbrains.kotlin.resolve.lazy.declarations.DeclarationProviderFactory -import org.jetbrains.kotlin.synthetic.AdditionalScopesWithJavaSyntheticExtensions public fun StorageComponentContainer.configureJavaTopDownAnalysis(moduleContentScope: GlobalSearchScope, project: Project, lookupTracker: LookupTracker) { useInstance(moduleContentScope) @@ -65,7 +64,6 @@ public fun StorageComponentContainer.configureJavaTopDownAnalysis(moduleContentS useImpl() useImpl() useImpl() - useImpl() } public fun createContainerForLazyResolveWithJava( diff --git a/compiler/frontend.java/src/org/jetbrains/kotlin/synthetic/AdditionalScopesWithJavaSyntheticExtensions.kt b/compiler/frontend.java/src/org/jetbrains/kotlin/synthetic/AdditionalScopesWithJavaSyntheticExtensions.kt deleted file mode 100644 index 0711e2eb720..00000000000 --- a/compiler/frontend.java/src/org/jetbrains/kotlin/synthetic/AdditionalScopesWithJavaSyntheticExtensions.kt +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2010-2015 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.kotlin.synthetic - -import org.jetbrains.kotlin.incremental.components.LookupTracker -import org.jetbrains.kotlin.resolve.lazy.FileScopeProvider -import org.jetbrains.kotlin.storage.StorageManager - -class AdditionalScopesWithJavaSyntheticExtensions(storageManager: StorageManager, lookupTracker: LookupTracker) : FileScopeProvider.AdditionalScopes { - override val scopes = listOf(JavaSyntheticPropertiesScope(storageManager, lookupTracker), SamAdapterFunctionsScope(storageManager)) -} diff --git a/compiler/frontend.java/src/org/jetbrains/kotlin/synthetic/JavaSyntheticPropertiesScope.kt b/compiler/frontend.java/src/org/jetbrains/kotlin/synthetic/JavaSyntheticPropertiesScope.kt index 18cb244c544..65632ac336e 100644 --- a/compiler/frontend.java/src/org/jetbrains/kotlin/synthetic/JavaSyntheticPropertiesScope.kt +++ b/compiler/frontend.java/src/org/jetbrains/kotlin/synthetic/JavaSyntheticPropertiesScope.kt @@ -29,14 +29,16 @@ import org.jetbrains.kotlin.incremental.record import org.jetbrains.kotlin.load.java.JvmAbi import org.jetbrains.kotlin.name.Name import org.jetbrains.kotlin.resolve.DescriptorUtils -import org.jetbrains.kotlin.resolve.scopes.* +import org.jetbrains.kotlin.resolve.scopes.DescriptorKindFilter +import org.jetbrains.kotlin.resolve.scopes.SyntheticScope +import org.jetbrains.kotlin.resolve.scopes.SyntheticScopes +import org.jetbrains.kotlin.resolve.scopes.collectSyntheticExtensionProperties import org.jetbrains.kotlin.storage.StorageManager import org.jetbrains.kotlin.types.* import org.jetbrains.kotlin.types.typeUtil.isSubtypeOf import org.jetbrains.kotlin.types.typeUtil.isUnit import org.jetbrains.kotlin.util.capitalizeDecapitalize.capitalizeAsciiOnly import org.jetbrains.kotlin.util.capitalizeDecapitalize.capitalizeFirstWord -import org.jetbrains.kotlin.utils.Printer import org.jetbrains.kotlin.utils.addIfNotNull import java.util.* import kotlin.properties.Delegates @@ -73,7 +75,7 @@ interface SyntheticJavaPropertyDescriptor : PropertyDescriptor { } } -class JavaSyntheticPropertiesScope(storageManager: StorageManager, private val lookupTracker: LookupTracker) : BaseImportingScope(null), SyntheticScope { +class JavaSyntheticPropertiesScope(storageManager: StorageManager, private val lookupTracker: LookupTracker) : SyntheticScope { private val syntheticPropertyInClass = storageManager.createMemoizedFunction, SyntheticPropertyHolder> { pair -> syntheticPropertyInClassNotCached(pair.first, pair.second) } @@ -165,7 +167,7 @@ class JavaSyntheticPropertiesScope(storageManager: StorageManager, private val l return null } - override fun getContributedSyntheticExtensionProperties(receiverTypes: Collection, name: Name, location: LookupLocation): Collection { + override fun getSyntheticExtensionProperties(receiverTypes: Collection, name: Name, location: LookupLocation): Collection { var result: SmartList? = null val processedTypes: MutableSet? = if (receiverTypes.size() > 1) HashSet() else null for (type in receiverTypes) { @@ -195,7 +197,7 @@ class JavaSyntheticPropertiesScope(storageManager: StorageManager, private val l return result } - override fun getContributedSyntheticExtensionProperties(receiverTypes: Collection): Collection { + override fun getSyntheticExtensionProperties(receiverTypes: Collection): Collection { val result = ArrayList() val processedTypes = HashSet() receiverTypes.forEach { result.collectSyntheticProperties(it.constructor, processedTypes) } @@ -257,9 +259,8 @@ class JavaSyntheticPropertiesScope(storageManager: StorageManager, private val l return Name.identifier("set" + identifier.removePrefix(prefix)) } - override fun printStructure(p: Printer) { - p.println(javaClass.simpleName) - } + override fun getSyntheticExtensionFunctions(receiverTypes: Collection, name: Name, location: LookupLocation): Collection = emptyList() + override fun getSyntheticExtensionFunctions(receiverTypes: Collection): Collection = emptyList() private data class SyntheticPropertyHolder(val descriptor: PropertyDescriptor?, val lookedNames: List) { companion object { diff --git a/compiler/frontend.java/src/org/jetbrains/kotlin/synthetic/SamAdapterFunctionsScope.kt b/compiler/frontend.java/src/org/jetbrains/kotlin/synthetic/SamAdapterFunctionsScope.kt index 3431458ee1b..7f2653c6e96 100644 --- a/compiler/frontend.java/src/org/jetbrains/kotlin/synthetic/SamAdapterFunctionsScope.kt +++ b/compiler/frontend.java/src/org/jetbrains/kotlin/synthetic/SamAdapterFunctionsScope.kt @@ -26,12 +26,10 @@ import org.jetbrains.kotlin.load.java.typeEnhacement.enhanceSignature import org.jetbrains.kotlin.name.Name import org.jetbrains.kotlin.resolve.DescriptorUtils import org.jetbrains.kotlin.resolve.descriptorUtil.parentsWithSelf -import org.jetbrains.kotlin.resolve.scopes.BaseImportingScope import org.jetbrains.kotlin.resolve.scopes.DescriptorKindFilter import org.jetbrains.kotlin.resolve.scopes.SyntheticScope import org.jetbrains.kotlin.storage.StorageManager import org.jetbrains.kotlin.types.* -import org.jetbrains.kotlin.utils.Printer import java.util.* import kotlin.properties.Delegates @@ -39,7 +37,7 @@ interface SamAdapterExtensionFunctionDescriptor : FunctionDescriptor { val sourceFunction: FunctionDescriptor } -class SamAdapterFunctionsScope(storageManager: StorageManager) : BaseImportingScope(null), SyntheticScope { +class SamAdapterFunctionsScope(storageManager: StorageManager) : SyntheticScope { private val extensionForFunction = storageManager.createMemoizedFunctionWithNullableValues { function -> extensionForFunctionNotCached(function) } @@ -54,7 +52,7 @@ class SamAdapterFunctionsScope(storageManager: StorageManager) : BaseImportingSc return MyFunctionDescriptor.create(enhancedFunction) } - override fun getContributedSyntheticExtensionFunctions(receiverTypes: Collection, name: Name, location: LookupLocation): Collection { + override fun getSyntheticExtensionFunctions(receiverTypes: Collection, name: Name, location: LookupLocation): Collection { var result: SmartList? = null for (type in receiverTypes) { for (function in type.memberScope.getContributedFunctions(name, location)) { @@ -74,7 +72,7 @@ class SamAdapterFunctionsScope(storageManager: StorageManager) : BaseImportingSc } } - override fun getContributedSyntheticExtensionFunctions(receiverTypes: Collection): Collection { + override fun getSyntheticExtensionFunctions(receiverTypes: Collection): Collection { return receiverTypes.flatMapTo(LinkedHashSet()) { type -> type.memberScope.getContributedDescriptors(DescriptorKindFilter.FUNCTIONS) .filterIsInstance() @@ -82,9 +80,9 @@ class SamAdapterFunctionsScope(storageManager: StorageManager) : BaseImportingSc } } - override fun printStructure(p: Printer) { - p.println(javaClass.simpleName) - } + override fun getSyntheticExtensionProperties(receiverTypes: Collection, name: Name, location: LookupLocation): Collection = emptyList() + + override fun getSyntheticExtensionProperties(receiverTypes: Collection): Collection = emptyList() private class MyFunctionDescriptor( containingDeclaration: DeclarationDescriptor, diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/lazy/FileScopeProvider.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/lazy/FileScopeProvider.kt index c8d9315536b..f189b467c8e 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/lazy/FileScopeProvider.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/lazy/FileScopeProvider.kt @@ -17,7 +17,6 @@ package org.jetbrains.kotlin.resolve.lazy import org.jetbrains.kotlin.psi.KtFile -import org.jetbrains.kotlin.resolve.scopes.ImportingScope import org.jetbrains.kotlin.resolve.scopes.LexicalScope public interface FileScopeProvider { @@ -28,10 +27,6 @@ public interface FileScopeProvider { override fun getFileResolutionScope(file: KtFile) = throw UnsupportedOperationException("Should not be called") override fun getImportResolver(file: KtFile) = throw UnsupportedOperationException("Should not be called") } - - public interface AdditionalScopes { - public val scopes: List - } } diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/lazy/FileScopeProviderImpl.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/lazy/FileScopeProviderImpl.kt index 512cab527f2..32a33053ef2 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/lazy/FileScopeProviderImpl.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/lazy/FileScopeProviderImpl.kt @@ -29,7 +29,6 @@ import org.jetbrains.kotlin.resolve.scopes.ImportingScope import org.jetbrains.kotlin.resolve.scopes.LexicalScope import org.jetbrains.kotlin.resolve.scopes.SubpackagesImportingScope import org.jetbrains.kotlin.resolve.scopes.utils.memberScopeAsImportingScope -import org.jetbrains.kotlin.resolve.scopes.utils.withParent import org.jetbrains.kotlin.storage.StorageManager import org.jetbrains.kotlin.storage.getValue import org.jetbrains.kotlin.utils.sure @@ -40,8 +39,7 @@ public open class FileScopeProviderImpl( private val moduleDescriptor: ModuleDescriptor, private val qualifiedExpressionResolver: QualifiedExpressionResolver, private val bindingTrace: BindingTrace, - private val ktImportsFactory: KtImportsFactory, - private val additionalScopes: Iterable + private val ktImportsFactory: KtImportsFactory ) : FileScopeProvider { private val defaultImports by storageManager.createLazyValue { @@ -82,11 +80,6 @@ public open class FileScopeProviderImpl( scope = LazyImportScope(scope, allUnderImportResolver, LazyImportScope.FilteringKind.INVISIBLE_CLASSES, "All under imports in $debugName (invisible classes only)") - for (additionalScope in additionalScopes.flatMap { it.scopes }) { - assert(additionalScope.parent == null) - scope = additionalScope.withParent(scope) - } - scope = LazyImportScope(scope, defaultAllUnderImportResolver, LazyImportScope.FilteringKind.VISIBLE_CLASSES, "Default all under imports in $debugName (visible classes)") diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/lazy/LazyImportScope.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/lazy/LazyImportScope.kt index 891c9830e8f..f4506f2bd16 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/lazy/LazyImportScope.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/lazy/LazyImportScope.kt @@ -32,7 +32,6 @@ import org.jetbrains.kotlin.resolve.QualifiedExpressionResolver import org.jetbrains.kotlin.resolve.scopes.DescriptorKindFilter import org.jetbrains.kotlin.resolve.scopes.ImportingScope import org.jetbrains.kotlin.storage.StorageManager -import org.jetbrains.kotlin.types.KotlinType import org.jetbrains.kotlin.util.collectionUtils.concat import org.jetbrains.kotlin.utils.Printer import java.util.* @@ -201,38 +200,6 @@ class LazyImportScope( return importResolver.collectFromImports(name) { scope, name -> scope.getContributedFunctions(name, location) } } - override fun getContributedSyntheticExtensionProperties(receiverTypes: Collection, name: Name, location: LookupLocation): Collection { - if (filteringKind == FilteringKind.INVISIBLE_CLASSES) return listOf() - return importResolver.collectFromImports(name) { scope, name -> scope.getContributedSyntheticExtensionProperties(receiverTypes, name, location) } - } - - override fun getContributedSyntheticExtensionFunctions(receiverTypes: Collection, name: Name, location: LookupLocation): Collection { - if (filteringKind == FilteringKind.INVISIBLE_CLASSES) return listOf() - return importResolver.collectFromImports(name) { scope, name -> scope.getContributedSyntheticExtensionFunctions(receiverTypes, name, location) } - } - - override fun getContributedSyntheticExtensionProperties(receiverTypes: Collection): Collection { - // we do not perform any filtering by visibility here because all descriptors from both visible/invisible filter scopes are to be added anyway - if (filteringKind == FilteringKind.INVISIBLE_CLASSES) return listOf() - - return importResolver.storageManager.compute { - importResolver.indexedImports.imports.flatMapTo(LinkedHashSet()) { import -> - importResolver.getImportScope(import).getContributedSyntheticExtensionProperties(receiverTypes) - } - } - } - - override fun getContributedSyntheticExtensionFunctions(receiverTypes: Collection): Collection { - // we do not perform any filtering by visibility here because all descriptors from both visible/invisible filter scopes are to be added anyway - if (filteringKind == FilteringKind.INVISIBLE_CLASSES) return listOf() - - return importResolver.storageManager.compute { - importResolver.indexedImports.imports.flatMapTo(LinkedHashSet()) { import -> - importResolver.getImportScope(import).getContributedSyntheticExtensionFunctions(receiverTypes) - } - } - } - override fun getContributedDescriptors(kindFilter: DescriptorKindFilter, nameFilter: (Name) -> Boolean): Collection { // we do not perform any filtering by visibility here because all descriptors from both visible/invisible filter scopes are to be added anyway if (filteringKind == FilteringKind.INVISIBLE_CLASSES) return listOf() diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/scopes/Scopes.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/scopes/Scopes.kt index b3c111f6e1e..b8922249f5d 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/scopes/Scopes.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/scopes/Scopes.kt @@ -19,7 +19,6 @@ package org.jetbrains.kotlin.resolve.scopes import org.jetbrains.kotlin.descriptors.* import org.jetbrains.kotlin.incremental.components.LookupLocation import org.jetbrains.kotlin.name.Name -import org.jetbrains.kotlin.types.KotlinType import org.jetbrains.kotlin.utils.Printer // see utils/ScopeUtils.kt @@ -98,12 +97,6 @@ interface ImportingScope : HierarchicalScope { fun getContributedPackage(name: Name): PackageViewDescriptor? - fun getContributedSyntheticExtensionProperties(receiverTypes: Collection, name: Name, location: LookupLocation): Collection - fun getContributedSyntheticExtensionFunctions(receiverTypes: Collection, name: Name, location: LookupLocation): Collection - - fun getContributedSyntheticExtensionProperties(receiverTypes: Collection): Collection - fun getContributedSyntheticExtensionFunctions(receiverTypes: Collection): Collection - object Empty : BaseImportingScope(null) { override fun printStructure(p: Printer) { p.println("ImportingScope.Empty") @@ -135,30 +128,9 @@ abstract class BaseLexicalScope( get() = null } -abstract class BaseImportingScope(parent: ImportingScope?) : BaseHierarchicalScope(parent), ImportingScope, SyntheticScope { +abstract class BaseImportingScope(parent: ImportingScope?) : BaseHierarchicalScope(parent), ImportingScope { override val parent: ImportingScope? get() = super.parent as ImportingScope? override fun getContributedPackage(name: Name): PackageViewDescriptor? = null - - override fun getContributedSyntheticExtensionProperties(receiverTypes: Collection, name: Name, location: LookupLocation): Collection = emptyList() - - override fun getContributedSyntheticExtensionFunctions(receiverTypes: Collection, name: Name, location: LookupLocation): Collection = emptyList() - - override fun getContributedSyntheticExtensionProperties(receiverTypes: Collection): Collection = emptyList() - - override fun getContributedSyntheticExtensionFunctions(receiverTypes: Collection): Collection = emptyList() - - // temporary - override fun getSyntheticExtensionProperties(receiverTypes: Collection, name: Name, location: LookupLocation) - = getContributedSyntheticExtensionProperties(receiverTypes, name, location) - - override fun getSyntheticExtensionFunctions(receiverTypes: Collection, name: Name, location: LookupLocation) - = getContributedSyntheticExtensionFunctions(receiverTypes, name, location) - - override fun getSyntheticExtensionProperties(receiverTypes: Collection) - = getContributedSyntheticExtensionProperties(receiverTypes) - - override fun getSyntheticExtensionFunctions(receiverTypes: Collection) - = getContributedSyntheticExtensionFunctions(receiverTypes) } diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/scopes/utils/ScopeUtils.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/scopes/utils/ScopeUtils.kt index 028bf5ea09d..3a241f7a7fb 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/scopes/utils/ScopeUtils.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/scopes/utils/ScopeUtils.kt @@ -106,18 +106,6 @@ public fun MemberScope.memberScopeAsImportingScope(parentScope: ImportingScope? private class MemberScopeToImportingScopeAdapter(override val parent: ImportingScope?, val memberScope: MemberScope) : ImportingScope { override fun getContributedPackage(name: Name): PackageViewDescriptor? = null - override fun getContributedSyntheticExtensionProperties(receiverTypes: Collection, name: Name, location: LookupLocation) - = emptyList() - - override fun getContributedSyntheticExtensionFunctions(receiverTypes: Collection, name: Name, location: LookupLocation) - = emptyList() - - override fun getContributedSyntheticExtensionProperties(receiverTypes: Collection) - = emptyList() - - override fun getContributedSyntheticExtensionFunctions(receiverTypes: Collection) - = emptyList() - override fun getContributedDescriptors(kindFilter: DescriptorKindFilter, nameFilter: (Name) -> Boolean) = memberScope.getContributedDescriptors(kindFilter, nameFilter) diff --git a/idea/src/org/jetbrains/kotlin/idea/quickfix/replaceWith/ReplaceWithAnnotationAnalyzer.kt b/idea/src/org/jetbrains/kotlin/idea/quickfix/replaceWith/ReplaceWithAnnotationAnalyzer.kt index 5b8eb07a5f3..5125b57b7c7 100644 --- a/idea/src/org/jetbrains/kotlin/idea/quickfix/replaceWith/ReplaceWithAnnotationAnalyzer.kt +++ b/idea/src/org/jetbrains/kotlin/idea/quickfix/replaceWith/ReplaceWithAnnotationAnalyzer.kt @@ -94,9 +94,8 @@ object ReplaceWithAnnotationAnalyzer { val module = symbolDescriptor.module val explicitImportsScope = buildExplicitImportsScope(annotation, resolutionFacade, module) val defaultImportsScopes = buildDefaultImportsScopes(resolutionFacade, module) - val additionalScopes = resolutionFacade.getFrontendService(FileScopeProvider.AdditionalScopes::class.java) val scope = getResolutionScope(symbolDescriptor, symbolDescriptor, - listOf(explicitImportsScope) + defaultImportsScopes + additionalScopes.scopes) ?: return null + listOf(explicitImportsScope) + defaultImportsScopes) ?: return null var bindingContext = analyzeInContext(expression, module, scope, resolutionFacade)