<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">On Apr 4, 2016, at 8:13 PM, Joe Groff &lt;<a href="mailto:jgroff@apple.com" class="">jgroff@apple.com</a>&gt; wrote:<br class=""><div><blockquote type="cite" class="">On Apr 4, 2016, at 11:17 AM, Erica Sadun &lt;<a href="mailto:erica@ericasadun.com" class="">erica@ericasadun.com</a>&gt; wrote:<br class=""><div class=""><blockquote type="cite" style="font-family: Palatino-Roman; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">On Apr 4, 2016, at 12:13 PM, Joe Groff &lt;<a href="mailto:jgroff@apple.com" class="">jgroff@apple.com</a>&gt; wrote:<br class=""><blockquote type="cite" class="">On Apr 4, 2016, at 11:00 AM, Erica Sadun via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:<br class=""><blockquote type="cite" class="">Are there reasons that prevent using `Self` as a synonym for an instance's type name?<br class=""><br class="">Consider:<br class=""><br class="">struct MyStruct {<br class="">&nbsp;&nbsp;static func foo() { print("foo") }<br class="">&nbsp;&nbsp;func bar() {<br class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MyStruct.foo() // works<br class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.dynamicType.foo() // works<br class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Self.foo() // error<br class="">&nbsp;&nbsp;}<br class="">}<br class=""><br class="">Obviously, you can always name a type directly or use `self.dynamicType` but<br class="">neither solution does any favors for readability. Both approaches obscure intent,<span class="Apple-converted-space">&nbsp;</span><br class="">especially as type names grow large: `MyExtremelyLargeTypeName.staticMember`,<br class="">for example. Plus, as Kevin B pointed out to me, &nbsp;`self.dynamicType.classMember` &nbsp;<br class="">and `TypeName.classMember` may not be synonyms in class types with non-final members.<br class=""><br class="">I'd like to see `Self.staticMember` introduced as a synonym for `TypeName.staticMember`.<br class=""></blockquote><br class="">There's the wrinkle of inheritance, as there so often is. `Self` inside a class scope already means "the dynamic class of 'self'", not "the type this declaration statically appears within". Now, we really ought to allow you to utter Self in the bodies of class methods too. It would be consistent to extend that courtesy to value types, where dynamic `Self` always matches the static type, from that principle.<br class=""><br class="">-Joe<br class=""></blockquote><br class="">Would using another word or symbol fix that problem?<br class=""></blockquote><br style="font-family: Palatino-Roman; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Palatino-Roman; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">My preference would be for there to be only one Self, and have it always be the dynamic type of 'self'. Some people disagree, but I don't think it's all that onerous to have to write ClassName.foo if that's really what you specifically mean.</span><br style="font-family: Palatino-Roman; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Palatino-Roman; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Palatino-Roman; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">-Joe</span></div></blockquote><br class=""></div><div>There's a pleasing simplicity to that approach.</div><div><br class=""></div><div>-- E</div><div><br class=""></div><br class=""></body></html>