In Scala, what does
trait A <: B
mean? Is it just the same as
trait A extends B
?
Edited to add: I’m familiar with the syntax for type parameters, and what <: means in that context. However, in the above example it would seem to me that A is the name of the trait being declared, not a type parameter.
NOTE As of Scala 2.12.5 using
<:forextendsis deprecatedSeems to compile to the same thing.
The spec doesn’t explain this in “5.3.3 Traits”. But the Syntax Summary does mention this.
UPDATE It was introduced in r14632. With the compiler option
-Xexperimentalit marks the trait as abstract, for use with a proposed language feature Virtual Traits. Without-Xexperimental, it is a synonym for ‘extends’ that is allowed only for traits.