swift-module-digester: changing open class members to public can be source-breaking.

This commit is contained in:
Xi Ge
2018-09-27 14:38:59 -07:00
parent 0afafd1ca4
commit 6665b56e9d
8 changed files with 25 additions and 2 deletions

View File

@@ -727,6 +727,9 @@ static void detectDeclChange(NodePtr L, NodePtr R, SDKContext &Ctx) {
auto &Diags = Ctx.getDiags();
if (auto LD = dyn_cast<SDKNodeDecl>(L)) {
auto *RD = R->getAs<SDKNodeDecl>();
if (!Ctx.checkingABI() && LD->isOpen() && !RD->isOpen()) {
Diags.diagnose(SourceLoc(), diag::no_longer_open, LD->getScreenInfo());
}
// Diagnose static attribute change.
if (LD->isStatic() ^ RD->isStatic()) {