-
Notifications
You must be signed in to change notification settings - Fork 47
Closed
Description
This works:
import zio._
trait DgraphClient
object Example extends scala.App:
type DgClient = Has[DgClient.Service]
object DgClient:
trait Service:
val dgraphClient: UIO[DgraphClient]
val getDgClient: URIO[DgClient, DgraphClient] =
ZIO.accessM[DgClient](_.get.dgraphClient)
println("It compiles!")
However, if I remove the return type of getDgClient
like so:
import zio._
trait DgraphClient
object Example extends scala.App:
type DgClient = Has[DgClient.Service]
object DgClient:
trait Service:
val dgraphClient: UIO[DgraphClient]
val getDgClient =
ZIO.accessM[DgClient](_.get.dgraphClient)
println("It compiles!")
Then I get the following error message:
could not find implicit value for izumi.reflect.Tag[Example.DgClient.Service]. Did you forget to put on a Tag, TagK or TagKK context bound on one of the parameters in Example.DgClient.Service? e.g. def x[T: Tag, F[_]: TagK] = ....
I found:
izumi.reflect.Tag.tagFromTagMacro[Example.DgClient.Service]
But method tagFromTagMacro in object Tag does not match type izumi.reflect.Tag[Example.DgClient.Service].
Seems like that should work given that I am explicitly supplying the type parameter to accessM
.
Metadata
Metadata
Assignees
Labels
No labels