zio-grpc
zio-grpc copied to clipboard
Compile Error for Missing Bindable Service Implicit
Description:
I am unable to compile a simple gRPC server running on ZIO gRPC because it complains of missing implicit arguments even though I think I imported them. Here is what I did:
- I followed the directions for plugins/dependencies on the website.
- For my service, I generated a ZManaged with the type signature
ZManaged[Any, Nothing, ZioMyService.ZMyService[ZEnv, Any]]
- I added the service to
services
usingaddManaged
- At this point I see no compiler highlighting in IntelliJ for any kind of missing arguments
- When I run
sbt compile
I get the following error:
could not find implicit value for parameter bs: scalapb.zio_grpc.ZBindableService[ZioMyService.ZMyService[zio.ZEnv,Any]]
NOTE: I imported
import ZioMyService.ZMyService.genericBindable\n import scalapb.zio_grpc.CanBind.canBindAny
initially when there was a highlight. The import resolved the highlight but the compiler still cannot compile (or run) my server.
This uses versions:
- sbt-protoc 1.0.2
- zio-grpc-codegen 0.5.0
- Scala 2.13.6
- SBT 1.5.5
- JDK Azul Zulu 11
Update: I was able to get this to compile by using a ZIO
instead of ZManaged
but I still think this warrants looking at.
Thanks for reporting! Looks like something that should be fixed. Could you provide a minimal example of this error through a PR that adds a unit test under the e2e directory?
I would like to - I think I can get to it on Wednesday.
Although since this is a compile issue rather than a runtime issue, I don't know if the unit test is needed? Should I just create a ServerMain example?
Yes, we use tests also for compile-time, to make sure the APIs work as intended, and implicits can be found in the scenarios we want to support. This also helps preventing regressions for the use cases under test.
However, feel free to provide a reproducible example in any way that is convenient for you and I'll take a look and move it around as needed.
Hey @thesamet I am still tracking this just got a bit behind :)
@nsadeh does #301 fix it for you?