swift-module-digester: fix a false positive when diagnosing super class changes.

This commit is contained in:
Xi Ge
2018-09-24 17:31:11 -07:00
parent 0d9f92b1a7
commit 2182f5301e
3 changed files with 7 additions and 3 deletions

View File

@@ -710,9 +710,7 @@ static void diagnoseNominalTypeDeclChange(SDKNodeDeclType *L, SDKNodeDeclType *R
if (RSuperClass.empty()) {
Diags.diagnose(SourceLoc(), diag::super_class_removed, L->getScreenInfo(),
LSuperClass);
} else {
// FIXME: This will be a false positive if the new subclass is a subclass
// of the old type.
} else if (!contains(R->getClassInheritanceChain(), LSuperClass)) {
Diags.diagnose(SourceLoc(), diag::super_class_changed, L->getScreenInfo(),
LSuperClass, RSuperClass);
}