Self types in Scala