An existential type that came from a Scala-2 classfile cannot be mapped accurately to to a Scala-3 equivalent

I have used before vigoo’s clipp library with scala 2.13.

I am trying to use it from a scala3 application (scala 3.0.0-RC2): NicolasRouquette/scala3-bundle-closure: OML Bundle Closure implementation in Scala3 (github.com)

I get this compilation error at the end:

[IJ]compile
[info] compiling 7 Scala sources to C:\Users\rouquette\GitHub\scala3-bundle-closure\target\scala-3.0.0-RC2\classes ...
[error] An existential type that came from a Scala-2 classfile cannot be
[error] mapped accurately to to a Scala-3 equivalent.
[error] original type    : (S[X], X => cats.free.Free[S, A]) forSome X
[error] reduces to       : (S[X], X => cats.free.Free[S, A])
[error] type used instead: (S[Any], Any => cats.free.Free[S, A])
[error] This choice can cause follow-on type errors or hide type errors.
[error] Proceed at own risk.
[error] one error found
[error] one error found
[error] (Compile / compileIncremental) Compilation failed

Although the error makes sense at a conceptual level, it would be helpful to find out which type is causing this.

It is difficult to track down this error with the current state of the Scala3 IDE support (vscode with metals or Intellij).

Can anyone shed some light about how to track down where this error comes from and how to resolve it?

  • Nicolas.

This is not a solution but hopefully a temporary workaround:

NicolasRouquette/scala3-bundle-closure at scala3-only (branch scala3-only)

I copied the source code that I really needed from clipp and kebs; migrated to scala3 and thus avoided solving the existential type problem in scala 2.13 libraries.

  • Nicolas.