mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Implement SE-0117.
One minor revision: this lifts the proposed restriction against overriding a non-open method with an open one. On reflection, that was inconsistent with the existing rule permitting non-public methods to be overridden with public ones. The restriction on subclassing a non-open class with an open class remains, and is in fact consistent with the existing access rule.
This commit is contained in:
@@ -1546,6 +1546,7 @@ static uint8_t getRawStableAccessibility(Accessibility access) {
|
||||
CASE(FilePrivate)
|
||||
CASE(Internal)
|
||||
CASE(Public)
|
||||
CASE(Open)
|
||||
#undef CASE
|
||||
}
|
||||
}
|
||||
@@ -3777,7 +3778,7 @@ static void writeDeclCommentTable(
|
||||
// we want to take the testability state into account
|
||||
// and emit documentation if and only if they are visible to clients
|
||||
// (which means public ordinarily, but public+internal when testing enabled).
|
||||
if (VD->getEffectiveAccess() != Accessibility::Public)
|
||||
if (VD->getEffectiveAccess() < Accessibility::Public)
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user