If I have a package hierarchy in Scala like this:
package toplevel {
package a {
// some interesting stuff
}
package b {
// more interesting stuff
}
package utility {
// stuff that should not be accessible from the outside
// and is not logically related to the project,
// basically some helper objects
}
}
how can I forbid the users of package toplevel
to see or import package utility
?
I tried with private[toplevel] package utility { ...
but got this error: expected start of definition
.
I've searched for this and was overwhelmed by false positives: everything I got was about making things package-private and this is not my question.