Re: AnyVal makes private case class constructor public

som-snytt <[email protected]> Thu, 14 Apr 2016 14:10:16 -0700 (PDT)
Newsgroups gmane.comp.lang.scala
Message-ID <[email protected]>
Gitter seems to have made the lists moribund.

I don't see the behavior you report. Related 
https://issues.scala-lang.org/browse/SI-9425

$ scala
Welcome to Scala 2.11.8 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_60).
Type in expressions for evaluation. Or try :help.

scala> :pa
// Entering paste mode (ctrl-D to finish)

case class C private(i: Int)

C(42).i

// Exiting paste mode, now interpreting.

defined class C
res0: Int = 42

scala> :pa
// Entering paste mode (ctrl-D to finish)

case class C private(i: Int) extends AnyVal

C(42).i

// Exiting paste mode, now interpreting.

defined class C
res1: Int = 42

scala> 


On Tuesday, April 5, 2016 at 11:14:51 AM UTC-7, Philippe Suter wrote:
>
> I'm wondering if the observed behavior is intentional; in the attached 
> file, I expect the three class construction calls to fail, but only the 
> ones commented out do.
>
> It seems that having a case class extends AnyVal renders its constructor 
> public.
>
> Maybe a special case of https://github.com/scala/scala/pull/2236 ?
>
> Tested on Scala 2.11.8.
>
> Best regards,
> PS
>

-- 
You received this message because you are subscribed to the Google Groups "scala-language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.