Referring to trait inside trait

179 Views Asked by At

What do I need the type of x to be in the following code to be able to refer to x.f in g()? A.B didn't work.

trait A {
    trait B {
        def f: Unit
    }
}

object O {
    def g(x : ?): Unit {
        x.f
    }
}
0

There are 0 best solutions below