score:0

Accepted answer

Could you achieve a similar effect by just nesting the query in the model?

trait FrameworkModel {
  val model = this
  trait FrameworkQuery {
    type T = model.type
    def getModel: T = model
  }
}

class UserModel extends FrameworkModel {
  // model stuff...
  object UserQuery extends FrameworkQuery {
    // query stuff... 
  }
}

score:0

trait T{
    type X = this.type
    def x: X = this
}
object A extends T{
    def b = "Yep"
}    
scala> A.x.b
res0: java.lang.String = Yep

Related Query

More Query from same tag