@@ -501,14 +501,13 @@ declaration in a template. Such members can be accessed only from
501501within the directly enclosing template and its companion module or
502502[ companion class] ( #object-definitions ) .
503503
504- The modifier can be _ qualified_ with an identifier $C$ (e.g.
505- ` private[$C$] ` ) that must denote a class or package
506- enclosing the definition. Members labeled with such a modifier are
507- accessible respectively only from code inside the package $C$ or only
508- from code inside the class $C$ and its
504+ A ` private ` modifier can be _ qualified_ with an identifier $C$ (e.g.
505+ ` private[$C$] ` ) that must denote a class or package enclosing the definition.
506+ Members labeled with such a modifier are accessible respectively only from code
507+ inside the package $C$ or only from code inside the class $C$ and its
509508[ companion module] ( #object-definitions ) .
510509
511- An different form of qualification is ` private[this] ` . A member
510+ A different form of qualification is ` private[this] ` . A member
512511$M$ marked with this modifier is called _ object-protected_ ; it can be accessed only from within
513512the object in which it is defined. That is, a selection $p.M$ is only
514513legal if the prefix is ` this ` or ` $O$.this ` , for some
@@ -533,11 +532,10 @@ Protected members of a class can be accessed from within
533532 - all templates that have the defining class as a base class,
534533 - the companion module of any of those classes.
535534
536- A ` protected ` modifier can be qualified with an
537- identifier $C$ (e.g. ` protected[$C$] ` ) that must denote a
538- class or package enclosing the definition. Members labeled with such
539- a modifier are also accessible respectively from all code inside the
540- package $C$ or from all code inside the class $C$ and its
535+ A ` protected ` modifier can be qualified with an identifier $C$ (e.g.
536+ ` protected[$C$] ` ) that must denote a class or package enclosing the definition.
537+ Members labeled with such a modifier are also accessible respectively from all
538+ code inside the package $C$ or from all code inside the class $C$ and its
541539[ companion module] ( #object-definitions ) .
542540
543541A protected identifier $x$ may be used as a member name in a selection
@@ -744,7 +742,7 @@ which when applied to parameters conforming to types $\mathit{ps}$
744742initializes instances of type `$c$[$\mathit{tps}\,$]` by evaluating the template
745743$t$.
746744
747- ###### Example
745+ ###### Example – `val` and `var` parameters
748746The following example illustrates `val` and `var` parameters of a class `C`:
749747
750748```scala
@@ -753,7 +751,7 @@ val c = new C(1, "abc", List())
753751c.z = c.y :: c.z
754752```
755753
756- ### Example Private Constructor
754+ ###### Example – Private Constructor
757755The following class can be created only from its companion module.
758756
759757``` scala
@@ -835,7 +833,7 @@ This defines a class `LinkedList` with three constructors. The
835833second constructor constructs an singleton list, while the
836834third one constructs a list with a given head and tail.
837835
838- ## Case Classes
836+ ### Case Classes
839837
840838``` ebnf
841839TmplDef ::= `case' `class' ClassDef
0 commit comments