zio-macros icon indicating copy to clipboard operation
zio-macros copied to clipboard

accessible: Support methods with type parameters

Open mschuwalow opened this issue 6 years ago • 1 comments

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

mschuwalow avatar Nov 15 '19 14:11 mschuwalow

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

dgalichet avatar Dec 11 '19 10:12 dgalichet