Given the following traits and class. Why does this compile? Can this be actually used for something?
trait Container {
type A
}
trait AnotherContainer[B
In your example, the compiler adds the default type bounds of >: Nothing <: Any. The second example below shows a case where an abstract type becomes usable (if not useful).
scala> trait T { type A >: Nothing <: Any }
defined trait T
scala> 1: T#A
:6: error: type mismatch;
found : Int(1)
required: T#A
1: T#A
^
scala> trait T { type A >: Int <: Int }
defined trait T
scala> 1: T#A
res6: T#A = 1
scala> "": T#A
:6: error: type mismatch;
found : java.lang.String("")
required: T#A
"": T#A
^