Force recompile all call-sites of ExpectedActualResolver.{findActualForExpected, findExpectedForActual}

This is needed to workaround broken incremental compilation in JPS in
Kotlin plugin. The incremental compilation bug is reported KT-60759

In Kotlin plugin I created the same commit which changes the name of the
function on the call-site.

Review: https://jetbrains.team/p/kt/reviews/11039/timeline

After a few days in master branch, I will revert this commit
This commit is contained in:
Nikita Bobko
2023-07-27 12:54:08 +02:00
committed by teamcity
parent d39755b578
commit 529a1dd720
3 changed files with 8 additions and 7 deletions
@@ -54,7 +54,8 @@ object ExpectedActualResolver {
}
}
fun findExpectedForActual(
// incremental compilation workaround for KT-60759
fun findExpectedForActual_incrementalCompilationWorkaround(
actual: MemberDescriptor,
moduleFilter: (ModuleDescriptor) -> Boolean = allModulesProvidingExpectsFor(actual.module),
shouldCheckAbsenceOfDefaultParamsInActual: Boolean = false,
@@ -67,7 +68,7 @@ object ExpectedActualResolver {
is ClassifierDescriptorWithTypeParameters -> {
// TODO: replace with 'singleOrNull' as soon as multi-module diagnostic tests are refactored
val expectedClass =
findExpectedForActual(container, moduleFilter, shouldCheckAbsenceOfDefaultParamsInActual)?.values
findExpectedForActual_incrementalCompilationWorkaround(container, moduleFilter, shouldCheckAbsenceOfDefaultParamsInActual)?.values
?.firstOrNull()?.firstOrNull() as? ClassDescriptor
with(context) {
expectedClass?.getMembersForExpectClass(actual.name)?.filterIsInstance<CallableMemberDescriptor>().orEmpty()
@@ -183,7 +184,7 @@ fun MemberDescriptor.findAnyActualsForExpected(
fun MemberDescriptor.findCompatibleExpectsForActual(
moduleFilter: ModuleFilter = allModulesProvidingExpectsFor(module)
): List<MemberDescriptor> =
ExpectedActualResolver.findExpectedForActual(this, moduleFilter)?.get(Compatible).orEmpty()
ExpectedActualResolver.findExpectedForActual_incrementalCompilationWorkaround(this, moduleFilter)?.get(Compatible).orEmpty()
fun DeclarationDescriptor.findExpects(): List<MemberDescriptor> {
if (this !is MemberDescriptor) return emptyList()