I have a trait that representing some module that exposes some public method (think of a service):
trait X {
def exposeMe: AService = ...
def keepMeHidden: BService = ...
}
Then, I have a Y
module that requires services from X
. Clients of Y
also need one service from X
. But I don't want them to depend on whole X
, just on this one service. I would like to like "export" that one service to be public.
trait Y { this: X =>
def exposeMe2: AService = exposeMe
}
This works, but is there a way to keep the method name the same?