[swift-evolution] [Rejected] SE-0009 Require self for accessing instance members

Charles Srstka cocoadev at charlessoft.com
Wed Jan 6 15:06:13 CST 2016


> On Jan 6, 2016, at 1:34 PM, T.J. Usiyan <griotspeak at gmail.com> wrote:
> 
> On Wed, Jan 6, 2016 at 2:18 PM, Charles Srstka via swift-evolution <swift-evolution at swift.org <mailto:swift-evolution at swift.org>> wrote:
> 
> I just spent a half hour last night debugging an issue that turned out to be caused by something getting written to a property which I thought was being written to a local variable, due to implicit self.
> 
> 
> One point to make is that requiring self is *not* the only fix for that problem. You could also avoid shadowing. Which choice you make is up to you.

Avoiding shadowing (or avoiding anything else for that matter) is also possible to flub accidentally. There’s no optional warning about shadowing either, AFAICT.

Charles

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160106/8aecfba2/attachment-0001.html>


More information about the swift-evolution mailing list