On 22.05.2016 4:49, David Waite via swift-evolution wrote:
This is why I was suggesting earlier in this thread to focus on warnings when variables and methods are being shadowed, and now to declare in code that a name is meant to shadow another name. I suspect that (with sufficient bikeshedding) this would meet the bar for the swift always-on warnings.
Personally I support both : the optional warning(which is OFF by default) for implicit `self.` and warning + 'fix' for shadowing. In case we have no way(as I understand) for optional warning for 'self.', I'd like to move forward the idea of warning for shadowing and 'fix' for it. David, would you like to propose some Draft/proposal for this or start new thread to discuss?
Btw, the problem with static dispatch of some protocol extension methods (in parallel thread "Static Dispatch Pitfalls") has some intersections with this 'shadowing' problem: in case of static dispatch of protocol extension method, if type has the same method declared - this looks like type's method shadowing method in protocol extension. So, probably there could me some common solutions/keywords/etc for these problems.
_______________________________________________ swift-evolution mailing list [email protected] https://lists.swift.org/mailman/listinfo/swift-evolution
