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

Douglas Gregor dgregor at apple.com
Wed Jan 6 11:47:09 CST 2016


> On Jan 6, 2016, at 6:56 AM, Greg Parker via swift-evolution <swift-evolution at swift.org> wrote:
> 
> 
>> On Jan 6, 2016, at 6:17 AM, Honza Dvorsky via swift-evolution <swift-evolution at swift.org> wrote:
>> 
>> I remember this being discussed in the conversation about this proposal and I haven't seen anyone being *against* there being a compiler flag, assuming it's off by default.
> 
> We don't want language-changing compiler flags. swiftc doesn't even have flags to control warnings today, though I don't know if we'll be able to preserve that forever.
> 
> Style rules should be enforced by tools other than the compiler. 

I tend to agree with Greg, in part because I don’t like the idea of having a cornucopia of potentially-conflicting warning flags for different coding conventions within the compiler proper (e.g., -Wimplicit-self vs. -Wunnecessarily-qualified-self, for the opposite ends of the spectrum in this particular debate).

The core team did talk about such a warning flag briefly, and there was no consensus either way. We think this needs more discussion in the community, but not as a discussion specific to requiring “self.”. Rather, the question is “does checking of coding conventions belong in the Swift compiler or in a separate tool?” and “how do we decide which coding conventions are important/popular/useful enough to include?”

	- Doug



More information about the swift-evolution mailing list