As James said, you can't. His cheat makes my eyes bleed, and I suggest doing something else instead ;-)
I strongly recommend modifying the consumers of bop if you can. Rather than handing them an instance of Bippy#Boppy, hand them a pair comprising the value of the dependent type and the value that the type depends on,
trait DependentPack {
val bippy : Bippy
val boppy : bippy.Boppy
}
val bip = new Bippy
val bop = bip.bop
val dep = new DependentPack { val bippy = bip ; val boppy = bop }
foo(dep)
def foo(dp : DependentPack) = {
import dp._
// use bippy ...
// use boppy ...
}
Note that this is in part a workaround for the lack of dependent method types (enabled in scalac by adding the -Ydependent-method-types or -Xexperimental command line switches). If we had them, then we could drop artefacts like DependentPack and rewrite the above as,
val bip = new Bippy
val bop = bip.bop
foo(bip)(bop)
def foo(bippy : Bippy)(boppy : bippy.Boppy) = {
// use bippy ...
// use boppy ...
}
Needless to say, I think having dependent method types enabled by default would be highly desirable. Non-trivial uses of dependent types bring a world of pain with them in their absence unless you're very careful.