zio-macros
zio-macros copied to clipboard
accessible: Support methods with type parameters
Taken from discord:
@accessible("tasks")
trait WorkflowService {
val workflowService: WorkflowService.Service[Any]
}
object WorkflowService {
trait Service[R] {
def persistentStep[E, A](step: WorkflowStep, f: => ZIO[R, E, A]): ZIO[R, E, A]
def retriedStep[E, A](step: WorkflowStep, f: => ZIO[R, E, A]): ZIO[R, E, A]
}
}
fails to compile
Hi, I have a similar issue when trying to define service with that send T (which is bounded with a typeclass):
@accessible(">")
trait Messaging {
val messaging: Messaging.Service[Any]
}
object Messaging {
trait Service[R] {
def send[T: Record.Writer](topic: String, records: List[T]): RIO[R, Int]
}
}
The compiler is complaining with a not found type T