Skip to content

Instantly share code, notes, and snippets.

@hchoroomi
Forked from anonymous/fromScalaConsole.scala
Created August 25, 2012 10:56
Show Gist options
  • Save hchoroomi/3463672 to your computer and use it in GitHub Desktop.
Save hchoroomi/3463672 to your computer and use it in GitHub Desktop.
Post By ScalaConsole
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