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 c6da3ea1af0..95e0ea6e743 100644 --- a/compiler/frontend.java/src/org/jetbrains/kotlin/synthetic/JavaSyntheticPropertiesScope.kt +++ b/compiler/frontend.java/src/org/jetbrains/kotlin/synthetic/JavaSyntheticPropertiesScope.kt @@ -92,7 +92,7 @@ interface SyntheticJavaPropertyDescriptor : PropertyDescriptor, SyntheticPropert } } -class JavaSyntheticPropertiesScope(storageManager: StorageManager, private val lookupTracker: LookupTracker) : SyntheticScope { +class JavaSyntheticPropertiesScope(storageManager: StorageManager, private val lookupTracker: LookupTracker) : SyntheticScope.Default() { private val syntheticPropertyInClass = storageManager.createMemoizedFunction, SyntheticPropertyHolder> { pair -> syntheticPropertyInClassNotCached(pair.first, pair.second) @@ -205,18 +205,6 @@ class JavaSyntheticPropertiesScope(storageManager: StorageManager, private val l } } - override fun getSyntheticStaticFunctions(scope: ResolutionScope, name: Name, location: LookupLocation): Collection = - emptyList() - - override fun getSyntheticConstructors(scope: ResolutionScope, name: Name, location: LookupLocation): Collection = - emptyList() - - override fun getSyntheticStaticFunctions(scope: ResolutionScope): Collection = emptyList() - - override fun getSyntheticConstructors(scope: ResolutionScope): Collection = emptyList() - - override fun getSyntheticConstructor(constructor: ConstructorDescriptor): ConstructorDescriptor? = null - private fun collectSyntheticPropertiesByName( result: SmartList?, type: TypeConstructor, 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 a29f4a2ca0c..acea1170180 100644 --- a/compiler/frontend.java/src/org/jetbrains/kotlin/synthetic/SamAdapterFunctionsScope.kt +++ b/compiler/frontend.java/src/org/jetbrains/kotlin/synthetic/SamAdapterFunctionsScope.kt @@ -59,7 +59,7 @@ class SamAdapterFunctionsScope( private val samResolver: SamConversionResolver, private val deprecationResolver: DeprecationResolver, private val lookupTracker: LookupTracker -) : SyntheticScope { +) : SyntheticScope.Default() { private val samViaSyntheticScopeDisabled = languageVersionSettings.supportsFeature(LanguageFeature.NewInference) private val extensionForFunction = @@ -150,10 +150,6 @@ class SamAdapterFunctionsScope( } } - override fun getSyntheticExtensionProperties(receiverTypes: Collection, name: Name, location: LookupLocation): Collection = emptyList() - - override fun getSyntheticExtensionProperties(receiverTypes: Collection): Collection = emptyList() - override fun getSyntheticStaticFunctions(scope: ResolutionScope, name: Name, location: LookupLocation): Collection { if (samViaSyntheticScopeDisabled) return emptyList() diff --git a/core/descriptors/src/org/jetbrains/kotlin/resolve/scopes/SyntheticScopes.kt b/core/descriptors/src/org/jetbrains/kotlin/resolve/scopes/SyntheticScopes.kt index 169abed3b2c..8dfe8f02278 100644 --- a/core/descriptors/src/org/jetbrains/kotlin/resolve/scopes/SyntheticScopes.kt +++ b/core/descriptors/src/org/jetbrains/kotlin/resolve/scopes/SyntheticScopes.kt @@ -36,6 +36,60 @@ interface SyntheticScope { fun getSyntheticConstructors(scope: ResolutionScope): Collection fun getSyntheticConstructor(constructor: ConstructorDescriptor): ConstructorDescriptor? + + open class Default : SyntheticScope { + override fun getSyntheticExtensionProperties( + receiverTypes: Collection, + name: Name, + location: LookupLocation + ): Collection { + return emptyList() + } + + override fun getSyntheticMemberFunctions( + receiverTypes: Collection, + name: Name, + location: LookupLocation + ): Collection { + return emptyList() + } + + override fun getSyntheticStaticFunctions( + scope: ResolutionScope, + name: Name, + location: LookupLocation + ): Collection { + return emptyList() + } + + override fun getSyntheticConstructors( + scope: ResolutionScope, + name: Name, + location: LookupLocation + ): Collection { + return emptyList() + } + + override fun getSyntheticExtensionProperties(receiverTypes: Collection): Collection { + return emptyList() + } + + override fun getSyntheticMemberFunctions(receiverTypes: Collection): Collection { + return emptyList() + } + + override fun getSyntheticStaticFunctions(scope: ResolutionScope): Collection { + return emptyList() + } + + override fun getSyntheticConstructors(scope: ResolutionScope): Collection { + return emptyList() + } + + override fun getSyntheticConstructor(constructor: ConstructorDescriptor): ConstructorDescriptor? { + return null + } + } } interface SyntheticScopes {