Closed scabug closed 5 years ago
Imported From: https://issues.scala-lang.org/browse/SI-8821?orig=1 Reporter: @skyluc Affected Versions: 2.11.2
@skyluc said: Related Scala IDE worksheet tickets: https://github.com/scala-ide/scala-worksheet/issues/194 https://scala-ide-portfolio.assembla.com/spaces/scala-ide/tickets/1002237
@jsuereth said: I think I ran into an instance of this recently with combined vs. separate compilation: https://gist.github.com/jsuereth/bf94458a0d03035b58c3
@som-snytt said: The related fix makes the behavior uniform.
The equivocation about the apply and the ctor is common parlance:
http://stackoverflow.com/questions/38097490/scala-case-class-private-constructor-isnt-private
A private constructor of case class is only accessible in the class/companion object definition. Trying to access from anywhere else results a compilation error.
Except if the case class is defined in a method body.
I would expect the same behavior in both cases.