[swift-evolution] [Pitch] Make Self an alias for object type in object definition
Adam Nemecek
adamnemecek at gmail.com
Sun May 22 15:56:01 CDT 2016
Lol, I'll search harder next time. :-)
On Sun, May 22, 2016 at 11:30 AM, Erica Sadun <erica at ericasadun.com> wrote:
>
> https://github.com/apple/swift-evolution/blob/master/proposals/0068-universal-self.md
>
> It's dangerous to go alone. Take this with you.
>
> -- E
>
>
> On May 22, 2016, at 12:24 PM, Adam Nemecek via swift-evolution <
> swift-evolution at swift.org> wrote:
>
> What do you guys think about aliasing the type of the current object with
> the Self keyword?
>
> E.g. instead of writing
>
> class Test {
> static var value = 0
>
> func printValue() {
> print(Test.value)
> }
> }
>
>
> One could write
>
> class Test {
> static var value = 0
>
> func printValue() {
> print(Self.value)
> }
> }
>
>
>
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160522/1fe7313b/attachment.html>
More information about the swift-evolution
mailing list