Permalink
Browse files

Workaround for issue #1169

  • Loading branch information...
1 parent 23d98a8 commit 42ca1b10fef2d32e6891f21f282821436db75ded Joni Freeman committed Feb 28, 2012
@@ -65,6 +65,7 @@ private[json] object ScalaSigReader {
case TypeRefType(ThisType(_), symbol, _) if isPrimitive(symbol) => symbol
case TypeRefType(_, _, TypeRefType(ThisType(_), symbol, _) :: xs) => symbol
case TypeRefType(_, symbol, Nil) => symbol
+ case TypeRefType(_, _, args) if typeArgIndex >= args.length => findPrimitive(args(0))
case TypeRefType(_, _, args) =>
args(typeArgIndex) match {
case ref @ TypeRefType(_, _, _) => findPrimitive(ref)
@@ -52,6 +52,13 @@ object ExtractionBugs extends Specification("Extraction bugs Specification") {
parse("""{"nums":[10]}""").extract[HasCompanion] mustEqual HasCompanion(List(10))
}
+ "Issue 1169" in {
+ val json = JsonParser.parse("""{"data":[{"one":1, "two":2}]}""")
+ json.extract[Response] mustEqual Response(List(Map("one" -> 1, "two" -> 2)))
+ }
+
+ case class Response(data: List[Map[String, Int]])
+
case class OptionOfInt(opt: Option[Int])
case class PMap(m: Map[String, List[String]])

0 comments on commit 42ca1b1

Please sign in to comment.