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:
@@ -524,6 +524,7 @@ class SDKNodeDeclType: public SDKNodeDecl {
|
||||
// Check whether the type declaration is pulled from an external module so we
|
||||
// can incorporate extensions in the interested module.
|
||||
bool IsExternal;
|
||||
bool IsEnumExhaustive;
|
||||
bool HasMissingDesignatedInitializers;
|
||||
bool InheritsConvenienceInitializers;
|
||||
public:
|
||||
@@ -550,6 +551,11 @@ public:
|
||||
return EnumRawTypeName;
|
||||
}
|
||||
|
||||
bool isEnumExhaustive() const {
|
||||
assert(isEnum());
|
||||
return IsEnumExhaustive;
|
||||
}
|
||||
|
||||
bool hasMissingDesignatedInitializers() const {
|
||||
return HasMissingDesignatedInitializers;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user