How to fix "T does not conform to bound <: AnyKind"?

63 Views Asked by At

I have the following ZIO project

object MinimalCounterexample extends ZIOAppDefault {

  val fetch = {
    for {
      result <- Client.request("http://localhost:9123/whatever")
      data   <- result.body.asString
      _      <- zio.Console.printLine(data)
    } yield ()
  }

  override def run = fetch.provide(
    EventLoopGroup.auto(),
    ChannelFactory.auto,
  )

}

When I compile this I get this error:

io.netty.channel.ChannelFactory[io.netty.channel.Channel] does not conform to bound <: AnyKind

What gives? How do I fix this?

1

There are 1 best solutions below

0
On

The problem is due to passing -Yno-kind-polymorphism to the scala compiler.

Removing this flag from scalacOptions in build.sbt fixes the problem.