@@ -73,10 +73,14 @@ internal class BinaryCompatibilityChecker(
7373 val relevantMemberAccesses = context.project.memberAccesses
7474 .filterToOrderedSet { access -> access.owner in relevantDuplicateClassNames }
7575
76+ if (relevantMemberAccesses.isEmpty()) return null
77+
7678 val (matchingBinaryClasses, nonMatchingBinaryClasses) = relevantMemberAccesses.mapToSet { access ->
7779 binaryClassCapability.findMatchingClasses(access)
7880 }.reduce()
7981
82+ if (nonMatchingBinaryClasses.isEmpty()) return null
83+
8084 // There must be a compatible BinaryClass.<field|method> for each MemberAccess for the usage to be binary-compatible
8185 val isBinaryCompatible = relevantMemberAccesses.all { access ->
8286 when (access) {
@@ -204,11 +208,11 @@ internal class BinaryCompatibilityChecker(
204208 * it's only called on "relevant" classes. THIS class, however, can, via [findRelevantBinaryClasses].
205209 */
206210 private fun BinaryClass.partition (memberAccess : MemberAccess ): Pair <BinaryClass ?, BinaryClass ?> {
207- // There can be only one match
211+ // There can be only one match: [0, 1]
208212 val matchingFields = effectivelyPublicFields.firstOrNull { it.matches(memberAccess) }
209213 val matchingMethods = effectivelyPublicMethods.firstOrNull { it.matches(memberAccess) }
210214
211- // There can be many non-matches
215+ // There can be many non-matches: [0, ∞]
212216 val nonMatchingFields = effectivelyPublicFields.filterToOrderedSet { it.doesNotMatch(memberAccess) }
213217 val nonMatchingMethods = effectivelyPublicMethods.filterToOrderedSet { it.doesNotMatch(memberAccess) }
214218
0 commit comments