I have this situation
object SuperHorribleLongName {
trait X {
private[SuperHorribleLongName] def internalGaga() : Unit
}
}
and I'm trying to get something like this working:
object SuperHorribleLongName {
private type Sup = SuperHorribleLongName.type
trait X {
private[Sup] def internalGaga() : Unit
}
}
but that just gives me "error: Sup is not an enclosing class"
... I also tried type Sup = this.type
, but still it doesn't work.
Anyways to achieve a nice shortcut for my outer object when using as private scope parameter? I do want to keep the long name for the object, and I have lots of private methods, that's why it gets really in my way.
I'm know sure it suits your hierarchy, but what about putting all you private methods in a
Otherwise, you can always mimic a namespace :
It's not satisfying, since SHLN is visible, and turning it
private
prevents lifting X. And it's messy.So, let turn the problem inside/out :