I have a simple case class:
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])
When calling upickle.write
on an instance of the above class, I get the following exception:
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
What does this error message mean and how do I fix it?