mandubian / play-json-alone

Sample of Play2.2-SNAPSHOT JSON API used stand-alone
24 stars 0 forks source link

case class inside objects not resolved #5

Open Sciss opened 11 years ago

Sciss commented 11 years ago

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]
}
mandubian commented 11 years ago

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 notifications@github.com 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 .