Refine return type of MemberScope.getContributedFunctions
This commit is contained in:
+1
-1
@@ -139,7 +139,7 @@ class MemberDeserializer(private val c: DeserializationContext) {
|
||||
return lowSixBits + rest
|
||||
}
|
||||
|
||||
fun loadFunction(proto: ProtoBuf.Function): FunctionDescriptor {
|
||||
fun loadFunction(proto: ProtoBuf.Function): SimpleFunctionDescriptor {
|
||||
val flags = if (proto.hasFlags()) proto.flags else loadOldFlags(proto.oldFlags)
|
||||
val annotations = getAnnotations(proto, flags, AnnotatedCallableKind.FUNCTION)
|
||||
val receiverAnnotations = if (proto.hasReceiver())
|
||||
|
||||
+2
-2
@@ -203,8 +203,8 @@ class DeserializedClassDescriptor(
|
||||
override fun getContributedDescriptors(kindFilter: DescriptorKindFilter,
|
||||
nameFilter: (Name) -> Boolean): Collection<DeclarationDescriptor> = allDescriptors()
|
||||
|
||||
override fun computeNonDeclaredFunctions(name: Name, functions: MutableCollection<FunctionDescriptor>) {
|
||||
val fromSupertypes = ArrayList<FunctionDescriptor>()
|
||||
override fun computeNonDeclaredFunctions(name: Name, functions: MutableCollection<SimpleFunctionDescriptor>) {
|
||||
val fromSupertypes = ArrayList<SimpleFunctionDescriptor>()
|
||||
for (supertype in classDescriptor.getTypeConstructor().supertypes) {
|
||||
fromSupertypes.addAll(supertype.memberScope.getContributedFunctions(name, NoLookupLocation.FOR_ALREADY_TRACKED))
|
||||
}
|
||||
|
||||
+4
-4
@@ -48,7 +48,7 @@ abstract class DeserializedMemberScope protected constructor(
|
||||
}
|
||||
|
||||
private val functions =
|
||||
c.storageManager.createMemoizedFunction<Name, Collection<FunctionDescriptor>> { computeFunctions(it) }
|
||||
c.storageManager.createMemoizedFunction<Name, Collection<SimpleFunctionDescriptor>> { computeFunctions(it) }
|
||||
private val properties =
|
||||
c.storageManager.createMemoizedFunction<Name, Collection<PropertyDescriptor>> { computeProperties(it) }
|
||||
|
||||
@@ -63,7 +63,7 @@ abstract class DeserializedMemberScope protected constructor(
|
||||
return map
|
||||
}
|
||||
|
||||
private fun computeFunctions(name: Name): Collection<FunctionDescriptor> {
|
||||
private fun computeFunctions(name: Name): Collection<SimpleFunctionDescriptor> {
|
||||
val protos = functionProtos()[ProtoKey(name, isExtension = false)].orEmpty() +
|
||||
functionProtos()[ProtoKey(name, isExtension = true)].orEmpty()
|
||||
|
||||
@@ -75,10 +75,10 @@ abstract class DeserializedMemberScope protected constructor(
|
||||
return descriptors.toReadOnlyList()
|
||||
}
|
||||
|
||||
protected open fun computeNonDeclaredFunctions(name: Name, functions: MutableCollection<FunctionDescriptor>) {
|
||||
protected open fun computeNonDeclaredFunctions(name: Name, functions: MutableCollection<SimpleFunctionDescriptor>) {
|
||||
}
|
||||
|
||||
override fun getContributedFunctions(name: Name, location: LookupLocation): Collection<FunctionDescriptor> {
|
||||
override fun getContributedFunctions(name: Name, location: LookupLocation): Collection<SimpleFunctionDescriptor> {
|
||||
recordLookup(name, location)
|
||||
return functions(name)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user