> On Mar 28, 2016, at 2:30 PM, Jordan Rose via swift-evolution > <[email protected]> wrote: > > P.S. Extensions do make things a little more complicated, but again, there's > almost no precedent here, and pretty much everyone agrees that this new > scope-private access level shouldn't give access to extensions. That also > means there's an option to keep yourself from accidentally accessing > scope-private members in a member type: put the member type in an extension.
The only example that comes to mind is Ruby, where I can add new methods to an
existing class, and those new methods indeed have access to existing ‘private’
methods:
class A
private def foo()
puts “foo called”
end
end
A.new.foo() # error
class A
def bar() # add new bar method
foo()
end
end
A.new.bar() # prints “foo called”
signature.asc
Description: Message signed with OpenPGP using GPGMail
_______________________________________________ swift-evolution mailing list [email protected] https://lists.swift.org/mailman/listinfo/swift-evolution
