Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"incompatible type in overriding" when overriding ConnectionInterpreter #1938

Closed
felix-hedenstrom opened this issue Nov 1, 2023 · 3 comments

Comments

@felix-hedenstrom
Copy link
Contributor

Attempted to implement tracing using trace4cats for a doobie 1.0.0-RC4 transactor but encountered an error.

incompatible type in overriding
def getTypeMap: cats.data.Kleisli[F,java.sql.Connection,java.util.Map[String,Class[_]]] (defined in trait Visitor)
  with override def getTypeMap: cats.data.Kleisli[F,java.sql.Connection,java.util.Map[String,Class[_ <: Object]]] (defined in trait ConnectionInterpreter);
 found   : cats.data.Kleisli[F,java.sql.Connection,java.util.Map[String,Class[_ <: Object]]]
 required: cats.data.Kleisli[F,java.sql.Connection,java.util.Map[String,Class[_]]]
        new ConnectionInterpreter {

a similar implementation worked on version 1.0.0-RC2.

Here is a minimal example that compiles with small trivial modifications in 1.0.0-RC2 but that fails with the above error in 1.0.0-RC4

object CustomConnectionInterpreter {

  implicit val weakAsync: WeakAsync[IO] =
    WeakAsync.doobieWeakAsyncForAsync(Async[IO])

  (new KleisliInterpreter[IO](LogHandler.noop[IO]) {

    override lazy val ConnectionInterpreter: ConnectionInterpreter =
      new ConnectionInterpreter {}

  }).ConnectionInterpreter

}
@jatcwang
Copy link
Collaborator

jatcwang commented Nov 7, 2023

Hi @felix-hedenstrom, I've recently added the explicit return types in #1929, can you try 1.0-ed18814-SNAPSHOT and let me know if it works for you?
You'll need to add resolvers ++= Resolver.sonatypeOssRepos("snapshots"), to resolve snapshot versions.

@felix-hedenstrom
Copy link
Contributor Author

Using the latest snapshot it does compile! Do you know when the next release will be?

@jatcwang
Copy link
Collaborator

jatcwang commented Nov 7, 2023

I'll see whether there are any cleanups needed but otherwise there's nothing stopping me from making a release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants