play-json-alone icon indicating copy to clipboard operation
play-json-alone copied to clipboard

case class inside objects not resolved

Open Sciss opened this issue 11 years ago • 1 comments

Something is not good with the name scoping:

object Foo {
  case class Bar(i: Int, s: String)
}
object Test {
  val f: Format[Foo.Bar] = Json.format[Foo.Bar]
}

This fails with not found: value Bar.

Luckily there is a workaround:

object Test {
  import Foo.Bar
  val f: Format[Bar] = Json.format[Bar]
}

Sciss avatar Jul 02 '13 12:07 Sciss

Yes true... We prefer to keep the macro quite simple for now as you can define everything manually...

Pascal

On Tue, Jul 2, 2013 at 2:24 PM, Sciss [email protected] wrote:

Something is not good with the name scoping:

object Foo { case class Bar(i: Int, s: String) } object Test { val f: Format[Foo.Bar] = Json.format[Foo.Bar] }

This fails with not found: value Bar.

Luckily there is a workaround:

object Test { import Foo.Bar val f: Format[Bar] = Json.format[Bar] }

— Reply to this email directly or view it on GitHubhttps://github.com/mandubian/play-json-alone/issues/5 .

mandubian avatar Jul 02 '13 12:07 mandubian