Skip to content

Instantly share code, notes, and snippets.

@sullivan-
Created December 15, 2014 18:06
Show Gist options
  • Save sullivan-/4208990ffa9649d7b62a to your computer and use it in GitHub Desktop.
Save sullivan-/4208990ffa9649d7b62a to your computer and use it in GitHub Desktop.
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")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment