[swift-evolution] [Pitch] Make Self an alias for object type in object definition

Erica Sadun erica at ericasadun.com
Sun May 22 13:30:53 CDT 2016


https://github.com/apple/swift-evolution/blob/master/proposals/0068-universal-self.md <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/54fa4b18/attachment.html>


More information about the swift-evolution mailing list