Skip to content

Commit

Permalink
scala3: Remove workarounds for fixed Scala3 issue scala/scala3#13986
Browse files Browse the repository at this point in the history
  • Loading branch information
neko-kai committed Oct 13, 2022
1 parent 1a56e64 commit 43add64
Showing 1 changed file with 7 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,10 @@ package izumi.functional.bio

import izumi.functional.bio.DivergenceHelper.{Divergent, Nondivergent}

trait RootInstancesLowPriorityVersionSpecific extends RootInstancesLowPriorityVersionSpecific1 {
trait RootInstancesLowPriorityVersionSpecific {
@inline implicit final def Convert3To2[C[f[-_, +_, +_]] <: RootBifunctor[f], FR[-_, +_, +_], R0, T](
implicit BifunctorPlus: (Root & C[FR]) { // `Root &` required due to https://github.com/lampepfl/dotty/issues/13986
type Divergence = Nondivergent; type IsPredefined = T // `IsPredefined = T` is only for Scala 3
}
): Divergent.Of[C[λ[(`-R`, `+E`, `+A`) => FR[R0, E, A]]]] { type IsPredefined = T } = {
BifunctorPlus.asInstanceOf[Divergent.Of[C[λ[(`-R`, `+E`, `+A`) => FR[R0, E, A]]]] { type IsPredefined = T }]
}
}

trait RootInstancesLowPriorityVersionSpecific1 {
@inline implicit final def Convert3To2Temporal[C[f[-_, +_, +_]] <: RootBifunctor[f], FR[-_, +_, +_], R0, T](
implicit BifunctorPlus: (Temporal3[FR] & C[FR]) { // `Temporal3[FR] &` required due to https://github.com/lampepfl/dotty/issues/13986
type Divergence = Nondivergent; type IsPredefined = T // `IsPredefined = T` is only for Scala 3
implicit BifunctorPlus: C[FR] {
type Divergence = Nondivergent; type IsPredefined = T // `IsPredefined = T` is required only on Scala 3
}
): Divergent.Of[C[λ[(`-R`, `+E`, `+A`) => FR[R0, E, A]]]] { type IsPredefined = T } = {
BifunctorPlus.asInstanceOf[Divergent.Of[C[λ[(`-R`, `+E`, `+A`) => FR[R0, E, A]]]] { type IsPredefined = T }]
Expand All @@ -25,11 +15,11 @@ trait RootInstancesLowPriorityVersionSpecific1 {
trait BlockingIOLowPriorityVersionSpecific {

@inline implicit final def blockingConvert3To2[C[f[-_, +_, +_]] <: BlockingIO3[f], FR[-_, +_, +_], R, T](
implicit BlockingIO3: (BlockingIO3[FR] & C[FR]) { // `BlockingIO3[FR] &` required due to https://github.com/lampepfl/dotty/issues/13986
type Divergence = Nondivergent; type IsPredefined = T // `IsPredefined = T` is only for Scala 3
implicit BlockingIO3: C[FR] {
type Divergence = Nondivergent; type IsPredefined = T // `IsPredefined = T` is required only on Scala 3
}
): Divergent.Of[BlockingIO2[FR[R, +_, +_]]] { type IsPredefined = T } = {
BlockingIO3.asInstanceOf[Divergent.Of[BlockingIO2[FR[R, +_, +_]]] { type IsPredefined = T }]
): Divergent.Of[BlockingIO2[FR[R, + _, + _]]] { type IsPredefined = T } = {
BlockingIO3.asInstanceOf[Divergent.Of[BlockingIO2[FR[R, + _, + _]]] { type IsPredefined = T }]
}

}

0 comments on commit 43add64

Please sign in to comment.