Skip to content

Commit 4f0f774

Browse files
committed
Rename -> isInterfacePackageEffectivelyPublic
1 parent dc1c34d commit 4f0f774

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

include/swift/AST/Decl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2979,7 +2979,7 @@ class ValueDecl : public Decl {
29792979
/// - Has a @usableFromInline (or other inlinable) attribute,
29802980
/// - And is defined in a module built from a public or private
29812981
/// interface that does not contain package-name.
2982-
bool isPackageEffectivelyPublic() const;
2982+
bool isInterfacePackageEffectivelyPublic() const;
29832983

29842984
/// Returns \c true if this declaration is *not* intended to be used directly
29852985
/// by application developers despite the visibility.

lib/AST/ASTVerifier.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1016,7 +1016,7 @@ class Verifier : public ASTWalker {
10161016
if (!D->getASTContext().isAccessControlDisabled()) {
10171017
if (D->getFormalAccessScope().isPublic() &&
10181018
D->getFormalAccess() < AccessLevel::Public &&
1019-
!D->isPackageEffectivelyPublic()) {
1019+
!D->isInterfacePackageEffectivelyPublic()) {
10201020
Out << "non-public decl has no formal access scope\n";
10211021
D->dump(Out);
10221022
abort();

lib/AST/Decl.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4212,7 +4212,7 @@ bool ValueDecl::isUsableFromInline() const {
42124212
return false;
42134213
}
42144214

4215-
bool ValueDecl::isPackageEffectivelyPublic() const {
4215+
bool ValueDecl::isInterfacePackageEffectivelyPublic() const {
42164216
// If a package decl has a @usableFromInline (or other inlinable)
42174217
// attribute, and is defined in a module built from interface, it
42184218
// can be referenced by another module that imports it even though
@@ -4319,7 +4319,7 @@ static AccessLevel getAdjustedFormalAccess(const ValueDecl *VD,
43194319
if (useDC && VD->getASTContext().isAccessControlDisabled())
43204320
return getMaximallyOpenAccessFor(VD);
43214321

4322-
if (VD->isPackageEffectivelyPublic())
4322+
if (VD->isInterfacePackageEffectivelyPublic())
43234323
return AccessLevel::Public;
43244324

43254325
if (treatUsableFromInlineAsPublic &&
@@ -4504,7 +4504,7 @@ getAccessScopeForFormalAccess(const ValueDecl *VD,
45044504
case AccessLevel::Package: {
45054505
auto pkg = resultDC->getPackageContext(/*lookupIfNotCurrent*/ true);
45064506
if (!pkg) {
4507-
if (VD->isPackageEffectivelyPublic())
4507+
if (VD->isInterfacePackageEffectivelyPublic())
45084508
return AccessScope::getPublic();
45094509
// Instead of reporting and failing early, return the scope of resultDC to
45104510
// allow continuation (should still non-zero exit later if in script mode)
@@ -4641,7 +4641,7 @@ static bool checkAccess(const DeclContext *useDC, const ValueDecl *VD,
46414641
if (VD->getASTContext().isAccessControlDisabled())
46424642
return true;
46434643

4644-
if (VD->isPackageEffectivelyPublic())
4644+
if (VD->isInterfacePackageEffectivelyPublic())
46454645
return true;
46464646

46474647
auto access = getAccessLevel();

lib/Sema/TypeCheckProtocol.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4277,7 +4277,7 @@ ConformanceChecker::resolveWitnessViaLookup(ValueDecl *requirement) {
42774277
requiredAccessScope.requiredAccessForDiagnostics();
42784278
auto proto = conformance->getProtocol();
42794279
auto protoAccessScope = proto->getFormalAccessScope(DC);
4280-
if (proto->isPackageEffectivelyPublic())
4280+
if (proto->isInterfacePackageEffectivelyPublic())
42814281
return;
42824282

42834283
bool protoForcesAccess =

0 commit comments

Comments
 (0)