我有两个案例类:主题和报告(下面的定义):
case class Topic(name:String, queryWords:Set[String])
case class Report(dateRange: org.joda.time.Interval, queryWord: String, topics: Map[Topic,Boolean], allOtherTopics: Map[Topic,Boolean])
我有一份我要序列化的报告列表:reports: List[Report]
但它给了我一个scala.MatchError
..
val writer = new BufferedWriter(new FileWriter(file))
Serialization.write(reports, writer) <--error right here
..
开始或堆栈跟踪:
scala.MatchError: (Topic(steam,Set(steam)),true) (of class scala.Tuple2)
at net.liftweb.json.Extraction$$anonfun$decompose$1.apply(Extraction.sca
la:82) ~[lift-json_2.10-2.5-RC6.jar:2.5-RC6]
..
问:我的反序列化出了什么问题?
我序列化List[Topic]
很好。电梯/ scala是否在序列化地图时出现问题?