mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
SIL: Enum case constructors are fragile if the enum is public or @_versioned
This commit is contained in:
@@ -499,9 +499,16 @@ bool SILDeclRef::isFragile() const {
|
||||
DeclContext *dc;
|
||||
if (auto closure = getAbstractClosureExpr())
|
||||
dc = closure->getLocalContext();
|
||||
else
|
||||
else {
|
||||
dc = getDecl()->getInnermostDeclContext();
|
||||
|
||||
// Enum case constructors are serialized if the enum is @_versioned
|
||||
// or public.
|
||||
if (isEnumElement())
|
||||
if (cast<EnumDecl>(dc)->getEffectiveAccess() >= Accessibility::Public)
|
||||
return true;
|
||||
}
|
||||
|
||||
// This is stupid
|
||||
return (dc->getResilienceExpansion() == ResilienceExpansion::Minimal);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user