Provide a default implementation for 'SyntheticScope'
This commit is contained in:
+1
-13
@@ -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 =
|
private val syntheticPropertyInClass =
|
||||||
storageManager.createMemoizedFunction<Pair<ClassDescriptor, Name>, SyntheticPropertyHolder> { pair ->
|
storageManager.createMemoizedFunction<Pair<ClassDescriptor, Name>, SyntheticPropertyHolder> { pair ->
|
||||||
syntheticPropertyInClassNotCached(pair.first, pair.second)
|
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<FunctionDescriptor> =
|
|
||||||
emptyList()
|
|
||||||
|
|
||||||
override fun getSyntheticConstructors(scope: ResolutionScope, name: Name, location: LookupLocation): Collection<FunctionDescriptor> =
|
|
||||||
emptyList()
|
|
||||||
|
|
||||||
override fun getSyntheticStaticFunctions(scope: ResolutionScope): Collection<FunctionDescriptor> = emptyList()
|
|
||||||
|
|
||||||
override fun getSyntheticConstructors(scope: ResolutionScope): Collection<FunctionDescriptor> = emptyList()
|
|
||||||
|
|
||||||
override fun getSyntheticConstructor(constructor: ConstructorDescriptor): ConstructorDescriptor? = null
|
|
||||||
|
|
||||||
private fun collectSyntheticPropertiesByName(
|
private fun collectSyntheticPropertiesByName(
|
||||||
result: SmartList<PropertyDescriptor>?,
|
result: SmartList<PropertyDescriptor>?,
|
||||||
type: TypeConstructor,
|
type: TypeConstructor,
|
||||||
|
|||||||
+1
-5
@@ -59,7 +59,7 @@ class SamAdapterFunctionsScope(
|
|||||||
private val samResolver: SamConversionResolver,
|
private val samResolver: SamConversionResolver,
|
||||||
private val deprecationResolver: DeprecationResolver,
|
private val deprecationResolver: DeprecationResolver,
|
||||||
private val lookupTracker: LookupTracker
|
private val lookupTracker: LookupTracker
|
||||||
) : SyntheticScope {
|
) : SyntheticScope.Default() {
|
||||||
private val samViaSyntheticScopeDisabled = languageVersionSettings.supportsFeature(LanguageFeature.NewInference)
|
private val samViaSyntheticScopeDisabled = languageVersionSettings.supportsFeature(LanguageFeature.NewInference)
|
||||||
|
|
||||||
private val extensionForFunction =
|
private val extensionForFunction =
|
||||||
@@ -150,10 +150,6 @@ class SamAdapterFunctionsScope(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getSyntheticExtensionProperties(receiverTypes: Collection<KotlinType>, name: Name, location: LookupLocation): Collection<PropertyDescriptor> = emptyList()
|
|
||||||
|
|
||||||
override fun getSyntheticExtensionProperties(receiverTypes: Collection<KotlinType>): Collection<PropertyDescriptor> = emptyList()
|
|
||||||
|
|
||||||
override fun getSyntheticStaticFunctions(scope: ResolutionScope, name: Name, location: LookupLocation): Collection<FunctionDescriptor> {
|
override fun getSyntheticStaticFunctions(scope: ResolutionScope, name: Name, location: LookupLocation): Collection<FunctionDescriptor> {
|
||||||
if (samViaSyntheticScopeDisabled) return emptyList()
|
if (samViaSyntheticScopeDisabled) return emptyList()
|
||||||
|
|
||||||
|
|||||||
@@ -36,6 +36,60 @@ interface SyntheticScope {
|
|||||||
fun getSyntheticConstructors(scope: ResolutionScope): Collection<FunctionDescriptor>
|
fun getSyntheticConstructors(scope: ResolutionScope): Collection<FunctionDescriptor>
|
||||||
|
|
||||||
fun getSyntheticConstructor(constructor: ConstructorDescriptor): ConstructorDescriptor?
|
fun getSyntheticConstructor(constructor: ConstructorDescriptor): ConstructorDescriptor?
|
||||||
|
|
||||||
|
open class Default : SyntheticScope {
|
||||||
|
override fun getSyntheticExtensionProperties(
|
||||||
|
receiverTypes: Collection<KotlinType>,
|
||||||
|
name: Name,
|
||||||
|
location: LookupLocation
|
||||||
|
): Collection<PropertyDescriptor> {
|
||||||
|
return emptyList()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun getSyntheticMemberFunctions(
|
||||||
|
receiverTypes: Collection<KotlinType>,
|
||||||
|
name: Name,
|
||||||
|
location: LookupLocation
|
||||||
|
): Collection<FunctionDescriptor> {
|
||||||
|
return emptyList()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun getSyntheticStaticFunctions(
|
||||||
|
scope: ResolutionScope,
|
||||||
|
name: Name,
|
||||||
|
location: LookupLocation
|
||||||
|
): Collection<FunctionDescriptor> {
|
||||||
|
return emptyList()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun getSyntheticConstructors(
|
||||||
|
scope: ResolutionScope,
|
||||||
|
name: Name,
|
||||||
|
location: LookupLocation
|
||||||
|
): Collection<FunctionDescriptor> {
|
||||||
|
return emptyList()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun getSyntheticExtensionProperties(receiverTypes: Collection<KotlinType>): Collection<PropertyDescriptor> {
|
||||||
|
return emptyList()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun getSyntheticMemberFunctions(receiverTypes: Collection<KotlinType>): Collection<FunctionDescriptor> {
|
||||||
|
return emptyList()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun getSyntheticStaticFunctions(scope: ResolutionScope): Collection<FunctionDescriptor> {
|
||||||
|
return emptyList()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun getSyntheticConstructors(scope: ResolutionScope): Collection<FunctionDescriptor> {
|
||||||
|
return emptyList()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun getSyntheticConstructor(constructor: ConstructorDescriptor): ConstructorDescriptor? {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
interface SyntheticScopes {
|
interface SyntheticScopes {
|
||||||
|
|||||||
Reference in New Issue
Block a user