私は単純なケースクラスを持っています:
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
このエラー メッセージの意味と修正方法を教えてください。