Skip to content

Commit

Permalink
Reproduction for issue #371 (#443)
Browse files Browse the repository at this point in the history
  • Loading branch information
lihaoyi committed Feb 27, 2023
1 parent 8b9e447 commit b17aa10
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions upickle/test/src/upickle/AdvancedTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -333,9 +333,21 @@ object AdvancedTests extends TestSuite {
// rw(TypedFoo.Baz("lol"): TypedFoo, """{"$type": "upickle.TypedFoo.Baz", "s": "lol"}""")
// rw(TypedFoo.Quz(true): TypedFoo, """{"$type": "upickle.TypedFoo.Quz", "b": true}""")
// }
test("issue-371") {
val input = """{"head":"a","tail":[{"head":"b","tail":[]}]}"""
val expected = Node371("a", Some(Node371("b", None)))
val result = upickle.default.read[Node371](input)
assert(result == expected)
}
}
}

case class Node371(head: String, tail: Option[Node371])

object Node371 {
implicit val nodeRW: ReadWriter[Node371] = macroRW[Node371]
}

class Thing[T: upickle.default.Writer, V: upickle.default.Writer](t: Option[(V, T)]) {
implicitly[upickle.default.Writer[Option[(V, T)]]]
}
Expand Down

0 comments on commit b17aa10

Please sign in to comment.