Re: Re: Writing a Macro to Test if Value Equals to 5

Simon Schäfer <[email protected]>
Newsgroups gmane.comp.lang.scala
Message-ID <[email protected]>

On 09/13/2015 05:16 AM, Kevin Meredith wrote:
> Actually, I tried to use a `safe constructor` approach, i.e. make the 
> case class's constructor to be private & add a factory method.
>
> But that approach did not work.
>
> *Equals5.scala*
> *
> *
> package net
>
> import scala.language.experimental.macros
> import scala.reflect.macros.Context
>
> case class Equals5 private (value: Int) {
> require(value == 5)
> }
Change this private to a private[net].

-- 
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.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.