Thanks to visit codestin.com
Credit goes to github.com

Skip to content

ZIO 1.0.6 fails to compile implicit #4992

@juliano

Description

@juliano

I have the following code running on ZIO 1.0.5:

@accessible
object Example {
  trait Service {
    def foo[A](value: String)(implicit decoder: Decoder[A]): IO[Throwable, A]
  }
}

object AnotherService {
  case class Bar(value: Int)

  object Bar {
    implicit val decoder: Decoder[Bar] = deriveDecoder
  }

  def bar(implicit decoder: Decoder[Bar]): ZIO[Has[Example.Service], Throwable, Bar] =
    Example.foo[Bar]("hey")(decoder)
}

After migrating to ZIO 1.0.6, it fails to compile:

[error] /Users/juliano/dev/proj/src/main/scala/example/AnotherService.scala:14:28: not enough arguments for method foo: (implicit decoder: io.circe.Decoder[example.AnotherService.Bar], ev: izumi.reflect.Tag[example.Example.Service]): zio.ZIO[zio.Has[example.Example.Service] with Any,Throwable,example.AnotherService.Bar].
[error] Unspecified value parameter ev.
[error]     Example.foo[Bar]("hey")(Bar.decoder)

I've noticed it only happens when Bar.decoder is explicitly there, it compiles otherwise.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is neededmacros

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions