我有一个简单的案例类:
object Margin {
def apply(top: Int, right: Int, bottom: Int, left: Int): Margin = {
Margin(Some(top), Some(right), Some(bottom), Some(left))
}
}
case class Margin(top: Option[Int], right: Option[Int], bottom: Option[Int], left: Option[Int])
调用upickle.write
上述类的实例时,出现以下异常:
scala.ScalaReflectionException: value apply encapsulates multiple
overloaded alternatives and cannot be treated as a method. Consider
invoking `<offending symbol>.asTerm.alternatives` and manually picking
the required method
此错误消息是什么意思,我该如何解决?