Would you consider providing a non-implicit gen for semiauto derivation, e.g.
// Traditional behavior, auto-derivation
import org.scalacheck.magnolia.auto._
and
// Semi-auto derivation (gen not implicit and renamed)
import org.scalacheck.magnolia.semiauto._
case class Foo(...)
object Foo {
// deriveArbitrary is just a non-implicit version of gen
// like circe, caches result to save compile time and give predictable behavior
implicit val arbFoo: Arbitrary[Foo] = deriveArbitrary[Foo]
}
I think this is just a couple lines of change. This solves two problems I've seen:
Bloated compile times due to needlessly repeated macro generation for the same type
This is really bad for some reason with protobuf generated enum classes
Differences in how an arbitrary Foo is populated, among different tests, depending on what's in scope
Would you consider providing a non-implicit gen for semiauto derivation, e.g.
and
I think this is just a couple lines of change. This solves two problems I've seen:
Foo
is populated, among different tests, depending on what's in scope