Is there a way to instantiate an abstract type with an object in Scala? What I mean is something like this:
trait Processor {
/* 1. defining a type shortcut */
type ProcessorType = RequestTrait with ResponseTrait
/* 2. defining a method with default implementation */
def retry = new ProcessorType {
override def retry = None
}
/* 3. Compilation fails */
def reRetry = new RequestTrait with ResponseTrait {
override def retry = None
}
/* 4. This one works correctly */
}