From e28e8ad7b881aec0c77a273b2e22a94222db7268 Mon Sep 17 00:00:00 2001 From: Anna Kozlova Date: Fri, 21 Apr 2023 09:54:27 +0200 Subject: [PATCH] [AA] recognize library module by roots merging `LLFirSelectingCombinedSymbolProvider.selectFirstElementInClasspathOrder` relies on the fact that a candidate belongs to exactly one module. This can be not true for libraries, attached to multiple modules. In that case we need to accept "wrong module" to retrieve correct provider --- .../KtSourceModuleByCompilerConfiguration.kt | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/analysis/analysis-test-framework/tests/org/jetbrains/kotlin/analysis/test/framework/project/structure/KtSourceModuleByCompilerConfiguration.kt b/analysis/analysis-test-framework/tests/org/jetbrains/kotlin/analysis/test/framework/project/structure/KtSourceModuleByCompilerConfiguration.kt index b97106d475e..7dd67a13008 100644 --- a/analysis/analysis-test-framework/tests/org/jetbrains/kotlin/analysis/test/framework/project/structure/KtSourceModuleByCompilerConfiguration.kt +++ b/analysis/analysis-test-framework/tests/org/jetbrains/kotlin/analysis/test/framework/project/structure/KtSourceModuleByCompilerConfiguration.kt @@ -145,6 +145,19 @@ private class LibraryByRoots( override val platform: TargetPlatform get() = module.platform override val analyzerServices: PlatformDependentAnalyzerServices get() = module.analyzerServices override fun getBinaryRoots(): Collection = roots + override fun equals(other: Any?): Boolean { + if (this === other) return true + if (javaClass != other?.javaClass) return false + + other as LibraryByRoots + + return roots == other.roots + } + + override fun hashCode(): Int { + return roots.hashCode() + } + override val librarySources: KtLibrarySourceModule? get() = null }