I have the following classes defined:
file: PyRef.scala:
package mypackage
class PyBinding() {
...
}
trait PyRef {
type Binding = PyBinding
}
file: Link.scala:
class Link() extends PyRef {
override type Binding = Link.PyBindingImpl
}
object Link {
class PyBindingImpl() extends PyRef#Binding() {
}
}
In compilation, the following error was thrown:
Error:(222, 34) class type required but mypackage.PyBinding found
) extends PyRef#Binding() {
Why this happens and what should I do to circumvent it? I'm using Scala 2.10.
I don't think you can use type projections
A#B
in Scala as instantiatable class types. The following two things work