-
-
Save hchoroomi/3463672 to your computer and use it in GitHub Desktop.
Post By ScalaConsole
This file contains hidden or 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 Stringify { | |
val id: String | |
override def toString() = id | |
} | |
case class Username(id: String) extends Stringify | |
case class Password(id: String) extends Stringify | |
def login(u: Username, p: Password) = { | |
println("Login using u:" + u + " p:" + p) | |
} | |
login(Username("admin"), Password("pass")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment