Here's a slightly simpler way to run into the same issue:
scala> trait Foo
defined trait Foo
scala> trait Bar { this: Foo => }
defined trait Bar
scala> trait Baz extends Bar
<console>:9: error: illegal inheritance;
self-type Baz does not conform to Bar's selftype Bar with Foo
trait Baz extends Bar
^
The problem is that the compiler expects you to repeat the self-type constraint in the subtype definition. In my simplified case we'd write:
trait Baz extends Bar { this: Foo => }
In yours you just need to make the following change:
trait Controller extends AServiceComponent { this: ARepositoryComponent => }
This requirement makes some sense—it's reasonable to want someone using Controller
to be able to know about this dependency without looking at the types it inherits from.