Skip to content
This repository has been archived by the owner on Mar 16, 2020. It is now read-only.

accessible: Support methods with type parameters #60

Open
mschuwalow opened this issue Nov 15, 2019 · 1 comment
Open

accessible: Support methods with type parameters #60

mschuwalow opened this issue Nov 15, 2019 · 1 comment

Comments

@mschuwalow
Copy link
Member

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

@dgalichet
Copy link

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants