<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On May 10, 2016, at 9:01 AM, Timothy Wood <<a href="mailto:tjw@me.com" class="">tjw@me.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On May 10, 2016, at 8:56 AM, Chris Lattner via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: 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 class="Apple-interchange-newline">On May 10, 2016, at 7:50 AM, Erica Sadun via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:<br class=""><br class="">As a compile-time substitution, it could be used in any and all of the examples in your bullet list as a literal text replacement..<br class=""><br class="">Quick rundown:<br class=""><br class="">struct A {<br class=""> ...#Self... // #Self is substituted by A<br class="">}<br class=""><br class="">class B {<br class=""> ...#Self... // Self is substituted by B<br class="">}<br class=""><br class="">class C {<br class=""> ... #Self... // Self is substituted by C, which is the defining type at compile time<br class="">}<br class=""></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: 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: Helvetica; font-size: 12px; font-style: normal; font-variant: 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="">I think it would be surprising if #Self produced the name of the enclosing static type: Self produces the dynamic type, and we’d want to preserve consistency if it were named #Self.</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: 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=""></div></blockquote><div class=""><br class=""></div><div class=""><br class=""></div></div>I’m not sure I understand this comment -- if #Self should mean the same as Self, why would it get added? My whole point in suggesting #Self was that it mirrored #file and #line in that it was a compile time replacement of some static information.</div></div></blockquote><br class=""></div><div>I think I misunderstood “textual replacement” to mean that #Self returns a string.</div><br class=""><div class="">-Chris</div></body></html>