Skip to content

Instantly share code, notes, and snippets.

@rbaron
Created August 28, 2015 14:11
Show Gist options
  • Save rbaron/54af46b1bb9ba58076e4 to your computer and use it in GitHub Desktop.
Save rbaron/54af46b1bb9ba58076e4 to your computer and use it in GitHub Desktop.
Inheritance question
trait Individual[T] {
def mate(other: Individual[T]): Individual[T]
}
class Person[T] extends Individual[T] {
// This "overrides nothing":
override def mate(other: Person[T]): Person[T] = new Person[T]()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment