I am trying to specify that val constant is visible only to one object:
object Config {
private[my.pack.MyObject] val Some = Option("String")
}
// in package my.pack
object MyObject {
val Other = Config.Some
}
While compiling this I get an error:
[error] C:\path\Config.scala:17: ']' expected but '.' found.
[error] private[my.pack.MyObject] val Some = Option("String")
[error] ^
What is wrong? As I read about access qualifiers they can be a class or object, not a package, am I wrong?
val Someto an object other than the assigning object? I may be just confused, but shouldConfigbe able to assign a value toSomewhen it has no access to it? Can you explain a bit more about the use case?Configobject doesn't have access to its ownval.