trait AServiceComponent {
  self: BServiceComponent =>
  val aService = new AService
  class AService {
    println(s"hi from $this constructor, b is $bService")
    def greet: Unit =
      println(s"hi from $this greet, b is $bService")
  }
}

trait BServiceComponent {
  self: AServiceComponent =>
  val bService = new BService
  class BService {
    println(s"hi from $this constructor, a is $aService")
    def greet: Unit =
      println(s"hi from $this greet, a is $aService")
  }
}