Skip to content

Instantly share code, notes, and snippets.

@xuwei-k
Last active November 29, 2021 02:40
Show Gist options
  • Save xuwei-k/afe78856f95124c6ca5323beb7b32b5c to your computer and use it in GitHub Desktop.
Save xuwei-k/afe78856f95124c6ca5323beb7b32b5c to your computer and use it in GitHub Desktop.
Scala 3 binary incompatibility
[info] PrettyParamsMonocleSpecification
[info] Lenses
[info] ! lbraceLeft
[error] scala.MatchError: java.lang.NoSuchMethodError: cats.Invariant$.catsInstancesForId()Lcats/Comonad; (of class java.lang.NoSuchMethodError) (PrettyParamsMonocleSpecification.scala:8)argonaut.PrettyParamsMonocleSpecification$.check(PrettyParamsMonocleSpecification.scala:8)
[error] argonaut.PrettyParamsMonocleSpecification$.checkProperties(PrettyParamsMonocleSpecification.scala:8)
[error]
[info] ! lbraceRight
[error] scala.MatchError: java.lang.NoSuchMethodError: cats.Invariant$.catsInstancesForId()Lcats/Comonad; (of class java.lang.NoSuchMethodError) (PrettyParamsMonocleSpecification.scala:8)argonaut.PrettyParamsMonocleSpecification$.check(PrettyParamsMonocleSpecification.scala:8)
[error] argonaut.PrettyParamsMonocleSpecification$.checkProperties(PrettyParamsMonocleSpecification.scala:8)
[error]
[info] ! rbraceLeft
[error] scala.MatchError: java.lang.NoSuchMethodError: cats.Invariant$.catsInstancesForId()Lcats/Comonad; (of class java.lang.NoSuchMethodError) (PrettyParamsMonocleSpecification.scala:8)argonaut.PrettyParamsMonocleSpecification$.check(PrettyParamsMonocleSpecification.scala:8)
[error] argonaut.PrettyParamsMonocleSpecification$.checkProperties(PrettyParamsMonocleSpecification.scala:8)
[error]
@suppressUnusedImportWarningForScalaVersionSpecific
object Invariant extends ScalaVersionSpecificInvariantInstances with InvariantInstances0 {
- implicit def catsInstancesForId: Distributive[Id] with Comonad[Id] = cats.catsInstancesForId
+ implicit def catsInstancesForId
+ : Distributive[Id] with Bimonad[Id] with CommutativeMonad[Id] with NonEmptyTraverse[Id] =
+ cats.catsInstancesForId
implicit def catsMonadErrorForEither[A]: MonadError[Either[A, *], A] =
cats.instances.either.catsStdInstancesForEither[A]
implicit def catsInstancesForOption
* method catsInstancesForId()cats.Comonad in object cats.Invariant has a different result type in current version, where it is cats.Bimonad rather than cats.Comonad
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment