Created
May 20, 2014 01:08
-
-
Save nicholasren/75aa9cab97c89d1cd802 to your computer and use it in GitHub Desktop.
scala training example - structural types
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 Quack { | |
this: { def quack(): Unit } => | |
} | |
class Duck extends Quack { | |
def quack() = { | |
println("Quack, Quack...") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment