[swift-evolution] [RFC] #Self

Chris Lattner clattner at apple.com
Tue May 10 13:43:44 CDT 2016


> On May 10, 2016, at 9:03 AM, Matthew Johnson <matthew at anandabits.com> wrote:
> 
>>> 
>>> class C {
>>>  ... #Self... // Self is substituted by C, which is the defining type at compile time
>>> }
>> 
>> 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.
> 
> That's a fair critique.  Having a more distinct name will make it clear that the behavior is completely unrelated to Self.
> 
> How about #Type or #StaticType?

Either of those would make more sense to me than using # as a distinguisher for dynamic vs static.  This isn’t what we use # for.

-Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160510/0f335177/attachment.html>


More information about the swift-evolution mailing list