7

I was used to inherit from a trait like this:

trait A
trait B extends A

But recently I discovered by accident that it is also possible with <: :

trait A
trait B <: A

Why? What is the motivation? (Don't want to hear its written down in the specs.) It is not possible when a class comes into play.

Peter Schmitz
  • 5,824
  • 4
  • 26
  • 48
  • That looks like a historical syntax. I've never seen this anywhere. Probably worth deprecating in a future version. – sjrd Jul 27 '14 at 19:46
  • 1
    Pretty funny to hear that it's *not* written down in the spec. Surely time to deprecate or put behind the -source flag. – som-snytt Jul 28 '14 at 02:09

1 Answers1

5

This syntax was for an experimental language feature called virtual traits. It is a leftover from that. I would avoid the syntax as it can be confusing to people who don’t know about it (including you, since you had to ask this question).