Exposing a path-dependent type coming from a singleton type
问题 I'm trying to make Scala find the right type for a path-dependent type coming from a singleton type. First, here is the type container for the example, and one instance: trait Container { type X def get(): X } val container = new Container { type X = String def get(): X = "" } I can see the String in this first attempt (so I already have a working scenario): class WithTypeParam[C <: Container](val c: C) { def getFromContainer(): c.X = c.get() } val withTypeParam = new WithTypeParam[container