mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
swift-module-digester: diagnose type witness type changes when checking ABI stability.
This commit is contained in:
@@ -859,7 +859,21 @@ void swift::ide::api::SDKNodeType::diagnose(SDKNode *Right) {
|
||||
if (!RT || !shouldDiagnoseType(this))
|
||||
return;
|
||||
assert(isTopLevelType());
|
||||
|
||||
// Diagnose type witness changes when diagnosing ABI breakages.
|
||||
if (auto *Wit = dyn_cast<SDKNodeTypeWitness>(getParent())) {
|
||||
auto *Conform = Wit->getParent()->getAs<SDKNodeConformance>();
|
||||
if (Ctx.checkingABI() && getPrintedName() != RT->getPrintedName()) {
|
||||
Diags.diagnose(SourceLoc(), diag::type_witness_change,
|
||||
Conform->getNominalTypeDecl()->getScreenInfo(),
|
||||
Wit->getWitnessedTypeName(),
|
||||
getPrintedName(), RT->getPrintedName());
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
StringRef Descriptor = getTypeRoleDescription();
|
||||
assert(isa<SDKNodeDecl>(getParent()));
|
||||
auto LParent = cast<SDKNodeDecl>(getParent());
|
||||
assert(LParent->getKind() == RT->getParent()->getAs<SDKNodeDecl>()->getKind());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user