Characteristic inheritance with <:

I was inherited from this property:

 trait A trait B extends A 

But recently, I accidentally discovered that this is also possible with <: ::

 trait A trait B <: A 

Why? What is the motivation? (You do not want to hear what is written in the specifications.) This is not possible when the class enters the game.

+7
source share
1 answer

This syntax is for an experimental language function called virtual traits . It remains of this. I would avoid the syntax as it can confuse people who don't know about it (including you, since you should have asked this question).

+5
source

All Articles