diff options
-rw-r--r-- | spec/05-classes-and-objects.md | 7 | ||||
-rw-r--r-- | spec/09-top-level-definitions.md | 2 | ||||
-rw-r--r-- | test/files/pos/t9321.scala | 10 |
3 files changed, 14 insertions, 5 deletions
diff --git a/spec/05-classes-and-objects.md b/spec/05-classes-and-objects.md index a6908ba39f..28abe6c3bc 100644 --- a/spec/05-classes-and-objects.md +++ b/spec/05-classes-and-objects.md @@ -498,9 +498,7 @@ the validity and meaning of a modifier are as follows. The `private` modifier can be used with any definition or declaration in a template. Such members can be accessed only from within the directly enclosing template and its companion module or -[companion class](#object-definitions). They -are not inherited by subclasses and they may not override definitions -in parent classes. +[companion class](#object-definitions). The modifier can be _qualified_ with an identifier $C$ (e.g. `private[$C$]`) that must denote a class or package @@ -524,7 +522,8 @@ either class-private or object-private, but not if it is marked case the member is called _qualified private_. Class-private or object-private members may not be abstract, and may -not have `protected` or `override` modifiers. +not have `protected` or `override` modifiers. They are not inherited +by subclasses and they may not override definitions in parent classes. ### `protected` The `protected` modifier applies to class member definitions. diff --git a/spec/09-top-level-definitions.md b/spec/09-top-level-definitions.md index e3185d8b7d..b8a8dc7e0a 100644 --- a/spec/09-top-level-definitions.md +++ b/spec/09-top-level-definitions.md @@ -151,7 +151,7 @@ contain a class `B`, a compiler-time error would result. A _program_ is a top-level object that has a member method _main_ of type `(Array[String])Unit`. Programs can be -executed from a command shell. The program's command arguments are are +executed from a command shell. The program's command arguments are passed to the `main` method as a parameter of type `Array[String]`. diff --git a/test/files/pos/t9321.scala b/test/files/pos/t9321.scala new file mode 100644 index 0000000000..ed3a816656 --- /dev/null +++ b/test/files/pos/t9321.scala @@ -0,0 +1,10 @@ +object p { + trait A { + private[p] val qualifiedPrivateMember = 1 + } + + def useQualifiedPrivate(b: Mix) = + b.qualifiedPrivateMember // allowed +} + +trait Mix extends p.A |