Ammonite
Ammonite copied to clipboard
Ammonite bizarrely hangs on top level function when combined with cats-effect
I'm getting a very bizarre issue combining Ammonite 3 with cats-effect. The following script hangs between printing "1" and "2":
#!/usr/bin/env amm
import $ivy.`org.typelevel::cats-effect:3.1.1`
import cats.effect.IO
import cats.effect.unsafe.IORuntime
def g() : IO[Unit] = IO(())
object HelloWorld {
def f() : IO[Unit] = IO(())
val blah : IO[Unit] = for {
x <- f()
_ <- IO(println("1"))
y <- g()
_ <- IO(println("2"))
} yield ()
}
HelloWorld.blah.unsafeRunSync()(IORuntime.global)
It seems as though it hangs on call to the top level function g()
but not the member function f()
.
idk, but perhaps the root cause is similar to the notorious https://github.com/scala/bug/issues/9076