[swift-evolution] [Review #3] SE-0117: Allow distinguishing between public access and public overridability

Xiaodi Wu xiaodi.wu at gmail.com
Thu Jul 21 11:11:34 CDT 2016


On Thu, Jul 21, 2016 at 10:33 AM, Chris Lattner via swift-evolution <
swift-evolution at swift.org> wrote:

> Hello Swift community,
>
> The third review of "SE-0117: Allow distinguishing between public access
> and public overridability" begins now and runs through July 25. The
> proposal is available here:
>
>
> https://github.com/apple/swift-evolution/blob/master/proposals/0117-non-public-subclassable-by-default.md
>
> Reviews are an important part of the Swift evolution process. All reviews
> should be sent to the swift-evolution mailing list at
>
>         https://lists.swift.org/mailman/listinfo/swift-evolution
>
> or, if you would like to keep your feedback private, directly to the
> review manager.
>
> What goes into a review?
>
> The goal of the review process is to improve the proposal under review
> through constructive criticism and contribute to the direction of Swift.
> When writing your review, here are some questions you might want to answer
> in your review:
>
>         * What is your evaluation of the proposal?
>

Much improved. I would be happy with either of the alternatives about open
classes.


>         * Is the problem being addressed significant enough to warrant a
> change to Swift?
>

(See previous review.)


>         * Does this proposal fit well with the feel and direction of Swift?
>

Yes, almost entirely. One more nit. Now that `open` is proposed as a
standalone modifier (as opposed to `public open`), it should *not* be
composable with `internal`, etc. Here's why:

If I make an `internal` subclass of an `open` class, I should not be able
to have a `private open override`. In a [public] open subclass, I'd be
required to have a [public] open override. So too for an internal subclass
it doesn't make sense that the override might have less visibility than the
type itself. Forbidding accessory access control modifiers would have the
desired effect of enforcing the same visibility for an overriding open
member as for its containing type.

Moreover, from a learnability standpoint, seeing `private open` and
`internal open` sets up the expectation that `public open` might be
meaningful and not redundant, and that `open` might mean `internal open`
just as in (nearly) all other circumstances the absence of `private`,
`fileprivate`, and `public` implies `internal`. Since this is not true, and
since accessory access control modifiers should never be necessary as
discussed above, I'd advocate for forbidding the use of `open` in
conjunction with an explicit access level.

        * If you have used other languages or libraries with a similar
> feature, how do you feel that this proposal compares to those?
>         * How much effort did you put into your review? A glance, a quick
> reading, or an in-depth study?
>

(See previous review.)


>
> More information about the Swift evolution process is available at
>
>         https://github.com/apple/swift-evolution/blob/master/process.md
>
> Thank you,
>
> -Chris Lattner
> Review Manager
>
>
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160721/c7a54bb8/attachment.html>


More information about the swift-evolution mailing list