我有一个隐含值,这取决于另一个隐含值。当第二个在范围内时,我想导入第一个隐式:
trait B
trait A
implicit def provideAnA(implicit b:B) = {
implicit val a = new A{}
}
def myMeth(implicit a:A) = 42
{
implicit val implB = new B{}
// i would like to be able to pass this through compiler
myMeth()
}
这有可能吗?