[swift-evolution] Proposal: Re-instate mandatory self for accessing instance properties and functions

Stephen Celis stephen.celis at gmail.com
Mon Dec 14 17:05:55 CST 2015


On Mon, Dec 14, 2015 at 5:35 PM, Dan Loewenherz via swift-evolution <
swift-evolution at swift.org> wrote:

>
> 2. How can one reference a function with the same name as an instance
> method in the class from which you’re referencing from? E.g., in the above
> example, I believe that the “add” function is unreachable from within the
> class
> (please correct me if I’m wrong).


FWIW, I like implicit self but have been bit by this several times before.
You can use the current module's name to reference the free function, but
the error messaging you'll face beforehand doesn't make it easy to get to
that solution.

Stephen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20151214/f92ce4bc/attachment.html>


More information about the swift-evolution mailing list