Open
Description
Hi,
The project in the attachment makes the Scala 3.3.1 compiler crash on my machine. The complete code is:
import zio.ZLayer
import zio.{ZIO, Runtime, Task}
import cats.effect.Async
import zio.interop.catz.*
def foo =
ZIO.runtime[Any].flatMap: runtime =>
given Runtime[Any] = runtime
Async[Task]
(??? : Task[Unit])
And the important bit of the error message seems to be this:
java.lang.AssertionError: assertion failed: NoType while typechecking /home/matthias/minimized/backend/src/main/scala/Main.scala
I have attached the complete output of sbt compile
as a log file.
The crash goes away when I do either of the following:
- remove the dependency on
"dev.zio" %% "zio-http" % "3.0.0-RC2"
from build.sbt - set
scalaVersion
to3.3.0
in build.sbt
It then prints the following error:
[info] welcome to sbt 1.9.7 (Private Build Java 17.0.8.1)
[info] loading project definition from /home/matthias/minimized/project
[info] loading settings for project minimized from build.sbt ...
[info] set current project to minimized (in build file:/home/matthias/minimized/)
[info] Executing in batch mode. For better performance use sbt's shell
[info] compiling 1 Scala source to /home/matthias/minimized/backend/target/scala-3.3.1/classes ...
[error] -- [E172] Type Error: /home/matthias/minimized/backend/src/main/scala/Main.scala:9:15
[error] 9 | Async[Task]
[error] | ^
[error] |Could not find an instance of Monad for zio.Task.
[error] |I found:
[error] |
[error] | zio.interop.catz.asyncRuntimeInstance[E](
[error] | /* missing */summon[zio.Runtime[zio.clock.Clock & zio.interop.CBlocking]])
[error] |
[error] |But no implicit values were found that match type zio.Runtime[zio.clock.Clock & zio.interop.CBlocking].
[error] one error found
[error] (backend / Compile / compileIncremental) Compilation failed
[error] Total time: 6 s, completed 15.11.2023, 14:31:41