[swift-evolution] Proposal SE-0009 Reconsideration
David Waite
david at alkaline-solutions.com
Wed May 18 15:49:37 CDT 2016
> On May 18, 2016, at 1:43 PM, Krystof Vasa <kvasa at icloud.com> wrote:
>
> See my example with the tableView and the UITableViewDelegate on UITableViewController. `if let x = x` isn't the usual case. The usual case is that you have e.g. tableView instance on the class and a method that takes a tableView parameter.
That would be shadowing.
> Then you change the method signature not to include the parameter and the code still compiles, since the tableView reference now goes to the instance variable, which is wrong.
If the annotation/keyword behaved similar to ‘override’, then you would either have a shadowing warning before saying that there was shadowing, or afterward saying that you are using the annotation/keyword when shadowing isn’t happening.
>
> I agree that shadowing variables is not a good idea, but I stand by my point that it's potentially dangerous and error-prone to allow accessing instance variables without `self`.
>
> Krystof
>
-DW
More information about the swift-evolution
mailing list