@@ -1513,7 +1513,7 @@ class DeclAvailabilityChecker : public DeclVisitor<DeclAvailabilityChecker> {
1513
1513
loc = varDecl->getNameLoc ();
1514
1514
1515
1515
diagnoseTypeAvailability (typeRepr, type, loc,
1516
- Where.forReason (reason), flags);
1516
+ Where.withReason (reason), flags);
1517
1517
}
1518
1518
1519
1519
void checkGenericParams (const GenericContext *ownerCtx,
@@ -1541,8 +1541,8 @@ class DeclAvailabilityChecker : public DeclVisitor<DeclAvailabilityChecker> {
1541
1541
}
1542
1542
1543
1543
public:
1544
- explicit DeclAvailabilityChecker (Decl *D )
1545
- : Where(ExportContext::forDeclSignature(D) ) {}
1544
+ explicit DeclAvailabilityChecker (ExportContext where )
1545
+ : Where(where ) {}
1546
1546
1547
1547
// Force all kinds to be handled at a lower level.
1548
1548
void visitDecl (Decl *D) = delete;
@@ -1751,14 +1751,14 @@ class DeclAvailabilityChecker : public DeclVisitor<DeclAvailabilityChecker> {
1751
1751
return isExported (valueMember);
1752
1752
});
1753
1753
1754
- Where = wasWhere.forExported (hasExportedMembers);
1755
- checkType (ED->getExtendedType (), ED->getExtendedTypeRepr (), ED,
1754
+ Where = wasWhere.withExported (hasExportedMembers);
1755
+ checkType (ED->getExtendedType (), ED->getExtendedTypeRepr (), ED,
1756
1756
ExportabilityReason::ExtensionWithPublicMembers);
1757
1757
1758
1758
// 3) If the extension contains exported members or defines conformances,
1759
1759
// the 'where' clause must only name exported types.
1760
- Where = wasWhere.forExported (hasExportedMembers ||
1761
- !ED->getInherited ().empty ());
1760
+ Where = wasWhere.withExported (hasExportedMembers ||
1761
+ !ED->getInherited ().empty ());
1762
1762
checkConstrainedExtensionRequirements (ED, hasExportedMembers);
1763
1763
}
1764
1764
@@ -1857,9 +1857,12 @@ void swift::checkAccessControl(Decl *D) {
1857
1857
checkExtensionGenericParamAccess (ED);
1858
1858
}
1859
1859
1860
- // ExportabilityChecker().visit(D);
1861
- if (D->isImplicit () || isa<AccessorDecl>(D))
1860
+ if (isa<AccessorDecl>(D))
1862
1861
return ;
1863
1862
1864
- DeclAvailabilityChecker (D).visit (D);
1863
+ auto where = ExportContext::forDeclSignature (D);
1864
+ if (where.isImplicit ())
1865
+ return ;
1866
+
1867
+ DeclAvailabilityChecker (where).visit (D);
1865
1868
}
0 commit comments