Have you by any chance meant this?

You can extend a class, structure, or enumeration in any access context in 
which the class, structure, or enumeration is available. Any type members added 
in an extension have the same default access level as type members declared in 
the original type being extended. If you extend a public or internal type, any 
new type members you add will have a default access level of internal. If you 
extend a private type, any new type members you add will have a default access 
level of private.

[HERE]: Alternatively, you can mark an extension with an explicit access level 
modifier (for example, private extension) to set a new default access level for 
all members defined within the extension.

This new default can still be overridden within the extension for individual 
type members.

Source
This is not according SE–0025 to me. It’s how access control on extensions 
worked all the time (which I misunderstood when posting my first draft).



-- 
Adrian Zubarev
Sent with Airmail

Am 16. Juli 2016 um 20:04:38, Xiaodi Wu via swift-evolution 
([email protected]) schrieb:

According to SE-0025, a method moved from the body of a public struct into a 
public extension becomes public without modification. This is surprising 
behavior contrary to Swift's general rule of not exposing public API by default.
_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to