Skip to content

Commit ef6cde5

Browse files
committed
[MoveOnlyPartialConsumption] Fix visibility check.
The implementation of isUsableFromInline asserts that the function not be public, so check that it's not before calling it.
1 parent b6e8eca commit ef6cde5

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/SILOptimizer/Mandatory/MoveOnlyAddressCheckerUtils.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1732,6 +1732,7 @@ shouldEmitPartialMutationErrorForType(SILType ty, NominalTypeDecl *nominal,
17321732
// A non-frozen type can't be partially mutated within code built in its
17331733
// defining module if that code will be emitted into a client.
17341734
if (fn->getLinkage() == SILLinkage::PublicNonABI &&
1735+
nominal->getFormalAccess() < AccessLevel::Public &&
17351736
nominal->isUsableFromInline() &&
17361737
!hasExplicitFixedLayoutAnnotation(nominal)) {
17371738
return {PartialMutationError::nonfrozenUsableFromInlineType(ty, *nominal)};

0 commit comments

Comments
 (0)