Skip to content

Commit

Permalink
Swap two given definitions to satisfy new restriction
Browse files Browse the repository at this point in the history
  • Loading branch information
odersky authored and nicolasstucki committed Mar 11, 2024
1 parent 5c0f817 commit a618330
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ object Diffable extends DiffableLowImplicits:
given floatDiffable: Diffable[Float] = primitive
given doubleDiffable: Diffable[Double] = primitive

// scala collections
given mapDiffable[K: Diffable, V: Diffable, M <: Map[K, V]]: Diffable[M] = new MapDiffable[K, V, M]
given setDiffable[E: Diffable, S <: Set[E]]: Diffable[S] = new SetDiffable[E, S]
given seqDiffable[E: Diffable, S <: Seq[E]]: Diffable[S] = new SeqLinesDiffable[E, S]
given arrayDiffable[E: Diffable]: Diffable[Array[E]] = new ArrayDiffable

// basic elements
given stackTraceElementDiffable: Diffable[StackTraceElement] = new StackTraceElementDiffable
given exceptionDiffable[T <: Throwable]: Diffable[T] = new ThrowableDiffable[T]
Expand All @@ -54,12 +60,6 @@ object Diffable extends DiffableLowImplicits:
given tryDiffable[T: Diffable, S <: Try[T]]: Diffable[S] = new TryDiffable[T, S]
given failureDiffable: Diffable[Failure[Nothing]] = new FailureDiffable

// scala collections
given mapDiffable[K: Diffable, V: Diffable, M <: Map[K, V]]: Diffable[M] = new MapDiffable[K, V, M]
given setDiffable[E: Diffable, S <: Set[E]]: Diffable[S] = new SetDiffable[E, S]
given seqDiffable[E: Diffable, S <: Seq[E]]: Diffable[S] = new SeqLinesDiffable[E, S]
given arrayDiffable[E: Diffable]: Diffable[Array[E]] = new ArrayDiffable

trait DiffableLowImplicits extends DiffableLowImplicits2:
given optionDiffable[T: Diffable, S <: Option[T]]: Diffable[S] = new OptionDiffable[T, S]
given eitherDiffable[L: Diffable, R: Diffable, T <: Either[L, R]]: Diffable[T] = new EitherDiffable[L, R, T]
Expand Down

0 comments on commit a618330

Please sign in to comment.