mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
API checker: only diagnose adding enum cases to exhaustive enums
Adding new cases to a non-exhaustive enum type isn't source-breaking since it only triggers a warning. rdar://63464929
This commit is contained in:
@@ -1216,7 +1216,9 @@ public:
|
||||
if (!Ctx.checkingABI()) {
|
||||
if (auto *Var = dyn_cast<SDKNodeDeclVar>(Right)) {
|
||||
if (Var->getDeclKind() == DeclKind::EnumElement) {
|
||||
Var->emitDiag(Var->getLoc(), diag::enum_case_added);
|
||||
if (Var->getParent()->getAs<SDKNodeDeclType>()->isEnumExhaustive()) {
|
||||
Var->emitDiag(Var->getLoc(), diag::enum_case_added);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user