Skip to content

Commit

Permalink
[AA] recognize library module by roots
Browse files Browse the repository at this point in the history
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
  • Loading branch information
akozlova authored and teamcity committed Apr 27, 2023
1 parent d491fd2 commit e28e8ad
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<Path> = 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
}

0 comments on commit e28e8ad

Please sign in to comment.