Skip to content

Instantly share code, notes, and snippets.

@missingfaktor
Created June 21, 2016 21:54
Show Gist options
  • Save missingfaktor/3e70ae44f6714e7eeef29ecb90d88f64 to your computer and use it in GitHub Desktop.
Save missingfaktor/3e70ae44f6714e7eeef29ecb90d88f64 to your computer and use it in GitHub Desktop.
sealed trait JobDescription
sealed trait HasN {
def n: Int
}
case class JobOne(n: Int) extends JobDescription with HasN
case object JobTwo extends JobDescription
case class JobThree(n: Int) extends JobDescription with HasN
def taskOneWorker(job: JobOne): Unit = {
println(job.n)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment