diff --git a/core/deserialization/src/org/jetbrains/kotlin/serialization/deserialization/descriptors/DeserializedMemberScope.kt b/core/deserialization/src/org/jetbrains/kotlin/serialization/deserialization/descriptors/DeserializedMemberScope.kt index fd58de1898c..6ae67fb5645 100644 --- a/core/deserialization/src/org/jetbrains/kotlin/serialization/deserialization/descriptors/DeserializedMemberScope.kt +++ b/core/deserialization/src/org/jetbrains/kotlin/serialization/deserialization/descriptors/DeserializedMemberScope.kt @@ -19,6 +19,7 @@ package org.jetbrains.kotlin.serialization.deserialization.descriptors import com.google.protobuf.MessageLite import org.jetbrains.kotlin.descriptors.* import org.jetbrains.kotlin.incremental.components.LookupLocation +import org.jetbrains.kotlin.incremental.record import org.jetbrains.kotlin.name.Name import org.jetbrains.kotlin.resolve.scopes.DescriptorKindFilter import org.jetbrains.kotlin.resolve.scopes.KtScopeImpl @@ -81,7 +82,10 @@ public abstract class DeserializedMemberScope protected constructor( protected open fun computeNonDeclaredFunctions(name: Name, functions: MutableCollection) { } - override fun getFunctions(name: Name, location: LookupLocation): Collection = functions(name) + override fun getFunctions(name: Name, location: LookupLocation): Collection { + recordLookup(name, location) + return functions(name) + } private fun computeProperties(name: Name): Collection { val protos = propertyProtos()[ProtoKey(name, isExtension = false)].orEmpty() + @@ -98,9 +102,15 @@ public abstract class DeserializedMemberScope protected constructor( protected open fun computeNonDeclaredProperties(name: Name, descriptors: MutableCollection) { } - override fun getProperties(name: Name, location: LookupLocation): Collection = properties.invoke(name) + override fun getProperties(name: Name, location: LookupLocation): Collection { + recordLookup(name, location) + return properties.invoke(name) + } - override fun getClassifier(name: Name, location: LookupLocation) = getClassDescriptor(name) + override fun getClassifier(name: Name, location: LookupLocation): ClassifierDescriptor? { + recordLookup(name, location) + return getClassDescriptor(name) + } protected abstract fun getClassDescriptor(name: Name): ClassifierDescriptor? @@ -183,4 +193,8 @@ public abstract class DeserializedMemberScope protected constructor( p.popIndent() p.println("}") } + + private fun recordLookup(name: Name, from: LookupLocation) { + c.components.lookupTracker.record(from, this, name) + } }