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
GraalVM native image errors out with TypeNotPresentException
on Scala 3
#3030
Comments
Here's a minimization. Switching to Scala 2.13.8 makes the problem go away, so it seems to be specific to the Scala 3 encoding. If further minimized might even be a dotty issue. //> using scala "3.1.2"
//> using lib "org.typelevel::cats-effect:3.3.12"
import cats._
import cats.effect._
import cats.syntax.all._
object MyApp extends IOApp.Simple {
def run = foo[IO]
def foo[F[_]: Async: Parallel] = Async[F].unit &> Async[F].unit
} |
Note, I had a similar issue involving https://ben.kirw.in/decline/ and cats.Applicative.F. |
I still wonder if this can be classified as a regression in Scala 3 relative to Scala 2. Specifically that the backend is emitting some bytecode Graal doesn't like. There are many backend fixes in 2 that need to be ported to 3 so this could be one of them. |
So there was a very similar issue reported and fixed in dotty:
That fix first shipped in 3.2.0-RC1. Unfortunately, it doesn't seem to fix my minimization above 😕 |
TypeNotPresentException
on Scala 3
Do you mean it didn't work with released version of Scala and cats-effect? Something like
For me to fix it I had to first rebuild cats-effect snapshot using Scala 3.2.0-RC1 (as the issue is in bytecode of the library). |
Oh, right! D'oh, that makes sense 😄 thanks! |
I'm trying to run a small
http4s
example withscala-cli
and for fun I was trying to package it through GraalVM, but I'm running into an error into (what looks like) a cats-effect error.Steps to reproduce
If one has
scala-cli
installed, the following can be run to reproduce the error:Code is located here: https://gist.github.com/zetashift/bdefce3d692e6a626e6bf2ecaf218f48
Error
Short:
The long version: http://ix.io/40aH
Still having a lot of fun with Cats Effect and
scala-cli
so thank you all for this awesome library!The text was updated successfully, but these errors were encountered: