[Linker] Add option to control scope of DescriptorByIdSignatureFinder
Currently DescriptorByIdSignatureFinder performs lookup of descriptor not only in the given module but also in its dependencies. This behaviour is incorrect if we have some kind of relation (e.g. mapping) between moduleDescriptor and found descriptor. Thus, we add a handle to control search scope.
This commit is contained in:
+4
-1
@@ -111,7 +111,10 @@ class JvmIrLinker(currentModule: ModuleDescriptor?, logger: LoggingContext, buil
|
||||
// TODO: implement proper check whether `idSig` belongs to this module
|
||||
override fun contains(idSig: IdSignature): Boolean = true
|
||||
|
||||
private val descriptorFinder = DescriptorByIdSignatureFinder(moduleDescriptor, manglerDesc)
|
||||
private val descriptorFinder = DescriptorByIdSignatureFinder(
|
||||
moduleDescriptor, manglerDesc,
|
||||
DescriptorByIdSignatureFinder.LookupMode.MODULE_ONLY
|
||||
)
|
||||
|
||||
private fun resolveDescriptor(idSig: IdSignature): DeclarationDescriptor {
|
||||
return descriptorFinder.findDescriptorBySignature(idSig) ?: error("No descriptor found for $idSig")
|
||||
|
||||
Reference in New Issue
Block a user