Skip to content

Commit

Permalink
Fixes implicits ordering
Browse files Browse the repository at this point in the history
  • Loading branch information
matwojcik committed Dec 19, 2023
1 parent f854a26 commit 12991b0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 1 addition & 2 deletions scalacheck/src/io/github/iltotore/iron/scalacheck/all.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package io.github.iltotore.iron.scalacheck

object all:
export any.given
object all extends AnyArbitrary:
export char.given
export collection.given
export numeric.given
Expand Down
8 changes: 5 additions & 3 deletions scalacheck/src/io/github/iltotore/iron/scalacheck/any.scala
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ import org.scalacheck.Arbitrary.arbitrary

import scala.compiletime.constValue

object any extends LowPriorityArbitrary:
object any extends AnyArbitrary

trait AnyArbitrary extends LowPriorityArbitrary:

inline given strictEqual[A, V <: A]: Arbitrary[A :| StrictEqual[V]] = Arbitrary(Gen.oneOf(Seq(constValue[V]))).asInstanceOf

inline given union[A, C](using IsUnion[C]): Arbitrary[A :| C] = Arbitrary(unionGen[A, C])

trait LowPriorityArbitrary extends LowPriorityArbitrary2:
Expand All @@ -22,4 +24,4 @@ trait LowPriorityArbitrary extends LowPriorityArbitrary2:
trait LowPriorityArbitrary2:

inline given fallback[A: Arbitrary, C](using inline constraint: Constraint[A, C]): Arbitrary[A :| C] =
Arbitrary(arbitrary.filter(constraint.test(_))).asInstanceOf
Arbitrary(arbitrary.filter(constraint.test(_))).asInstanceOf

0 comments on commit 12991b0

Please sign in to comment.