Adapted fake override checker to inheritance from friend module internal interfaces
This commit is contained in:
+8
-25
@@ -40,14 +40,7 @@ class FakeOverrideChecker(
|
|||||||
.filter { it.kind == CallableMemberDescriptor.Kind.FAKE_OVERRIDE }
|
.filter { it.kind == CallableMemberDescriptor.Kind.FAKE_OVERRIDE }
|
||||||
.filterNot { it.visibility == Visibilities.PRIVATE || it.visibility == Visibilities.INVISIBLE_FAKE }
|
.filterNot { it.visibility == Visibilities.PRIVATE || it.visibility == Visibilities.INVISIBLE_FAKE }
|
||||||
|
|
||||||
val (internalDescriptorFakeOverrides, restDescriptorFakeOverrides) =
|
val descriptorSignatures = descriptorFakeOverrides
|
||||||
descriptorFakeOverrides.partition{ it.visibility == Visibilities.INTERNAL }
|
|
||||||
|
|
||||||
val internalDescriptorSignatures = internalDescriptorFakeOverrides
|
|
||||||
.map { with(descriptorMangler) { it.signatureString }}
|
|
||||||
.sorted()
|
|
||||||
|
|
||||||
val restDescriptorSignatures = restDescriptorFakeOverrides
|
|
||||||
.map { with(descriptorMangler) { it.signatureString }}
|
.map { with(descriptorMangler) { it.signatureString }}
|
||||||
.sorted()
|
.sorted()
|
||||||
|
|
||||||
@@ -59,28 +52,18 @@ class FakeOverrideChecker(
|
|||||||
checkOverriddenSymbols(it)
|
checkOverriddenSymbols(it)
|
||||||
}
|
}
|
||||||
|
|
||||||
val (internalIrFakeOverrides, restIrFakeOverrides) =
|
val irSignatures = irFakeOverrides
|
||||||
irFakeOverrides.partition{ it.visibility == Visibilities.INTERNAL }
|
|
||||||
|
|
||||||
val internalIrSignatures = internalIrFakeOverrides
|
|
||||||
.map { with(irMangler) { it.signatureString }}
|
.map { with(irMangler) { it.signatureString }}
|
||||||
.sorted()
|
.sorted()
|
||||||
|
|
||||||
val restIrSignatures = restIrFakeOverrides
|
// We can't have equality here because dependency libraries could have
|
||||||
.map { with(irMangler) { it.signatureString }}
|
// been compiled with -friend-modules.
|
||||||
.sorted()
|
|
||||||
|
|
||||||
require(restDescriptorSignatures == restIrSignatures) {
|
|
||||||
"[IR VALIDATION] Fake override mismatch for ${clazz.fqNameWhenAvailable!!}\n" +
|
|
||||||
"\tDescriptor based: $restDescriptorSignatures\n" +
|
|
||||||
"\tIR based : $restIrSignatures"
|
|
||||||
}
|
|
||||||
|
|
||||||
// There can be internal fake overrides in IR absent in descriptors.
|
// There can be internal fake overrides in IR absent in descriptors.
|
||||||
require(internalIrSignatures.containsAll(internalDescriptorSignatures)) {
|
// Also there can be members inherited from internal interfaces of other modules.
|
||||||
|
require(irSignatures.containsAll(descriptorSignatures)) {
|
||||||
"[IR VALIDATION] Internal fake override mismatch for ${clazz.fqNameWhenAvailable!!}\n" +
|
"[IR VALIDATION] Internal fake override mismatch for ${clazz.fqNameWhenAvailable!!}\n" +
|
||||||
"\tDescriptor based: $internalDescriptorSignatures\n" +
|
"\tDescriptor based: $descriptorSignatures\n" +
|
||||||
"\tIR based : $internalIrSignatures"
|
"\tIR based : $irSignatures"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user