Could be useful...
Your trick will work but we won't be able to pattern match on JsUndefined()
but on JsUndefined(_)...

On Thu, Jul 18, 2013 at 11:39 PM, Rich Dougherty
<notifications@github.com>wrote:

> In framework/src/play-json/src/main/scala/play/api/libs/json/JsValue.scala:
>
> > @@ -95,7 +92,14 @@ case object JsNull extends JsValue
> >  /**
> >   * Represent a missing Json value.
> >   */
> > -case class JsUndefined(error: String) extends JsValue
> > +class JsUndefined(err: => String) extends JsValue {
> > +  def error = err
> > +}
>
> Do you need equals() or toString() for JsUndefined? You could keep it as a
> case class (case class JsUndefined(val error: () => String)) and offer a
> JsUndefined.apply constructor that creates a JsUndefined from a by-name
> argument.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/playframework/playframework/pull/1350/files#r5280150>
> .
>