scala-hamsters/hamsters

DefaultValue for Numeric is unsound

tpolecat opened this issue · 1 comments

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.

That's right, thanks for the issue :)