You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
also worth pointing out that once I add my own (defmethod schema->gen BigDecimal ...) everything is fine -- the problem is just that I was confused prior to adding it.
(schema->gen BigDecimal)
returns a generator of floats, when I'd prefer that it would crash because it doesn't know how to generateBigDecimal
.The reason it does this is because the
s/Num
clause is using thejava.lang.Number
class which is a superclass ofBigDecimal
.I think inheritance for generators kind of works in the opposite direction (IS THIS WHAT CONTRAVARIANT MEANS??).
Not sure what the best fix is. Only idea I have is swapping
s/Num
forDouble
.The text was updated successfully, but these errors were encountered: