假设:
$scala
Welcome to Scala 2.11.8 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_101).
Type in expressions for evaluation. Or try :help.
scala> :paste
// Entering paste mode (ctrl-D to finish)
object F { def f(a: A) = a.hidden }
case class F(private [this] val hidden: Int)
// Exiting paste mode, now interpreting.
<console>:12: error: private[this] not allowed for case class parameters
case class F(private [this] val hidden: Int)
^
为什么案例类参数不允许private [this]
?