Created
November 7, 2009 14:50
-
-
Save retronym/228724 to your computer and use it in GitHub Desktop.
The special type this.type
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait T { | |
def me: this.type = this | |
} | |
class W { | |
def woohoo: String = "woohoo" | |
} | |
println((new W with T).me.woohoo) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment