swift-module-digester: diagnose removing default associated type as API breakage.

This commit is contained in:
Xi Ge
2018-09-21 14:14:36 -07:00
parent 6500e321aa
commit e8c604ff99
7 changed files with 27 additions and 0 deletions

View File

@@ -817,6 +817,13 @@ public:
case NodeMatchReason::Removed:
assert(!Right);
Left->annotate(NodeAnnotation::Removed);
if (auto *LT = dyn_cast<SDKNodeType>(Left)) {
if (auto *AT = dyn_cast<SDKNodeDeclAssociatedType>(LT->getParent())) {
Ctx.getDiags().diagnose(SourceLoc(),
diag::default_associated_type_removed,
AT->getScreenInfo(), LT->getPrintedName());
}
}
return;
case NodeMatchReason::FuncToProperty:
case NodeMatchReason::ModernizeEnum: