DefaultValue for Numeric is unsound
tpolecat opened this issue · 1 comments
tpolecat commented
scala> implicitly[DefaultValue[BigDecimal]].get
java.lang.ClassCastException: java.lang.Integer cannot be cast to scala.math.BigDecimal
... 38 elided
You need to use the .zero
member of Numeric[T]
instead of trying to cast 0
.
loicdescotte commented
That's right, thanks for the issue :)