-
Notifications
You must be signed in to change notification settings - Fork 118
Open
Description
Take this code for instance:
sealed trait TasksServiceConfig
object TasksServiceConfig {
case class GoogleCloudTasks(projectId: String, queueLocation: String, queueName: String) extends TasksServiceConfig
case object Disabled extends TasksServiceConfig
implicit val debugTasksServiceConfig: Debug[TasksServiceConfig] = {
@unused implicit val debugGoogleCloudTasks = DeriveDebug.derived[GoogleCloudTasks]
@unused implicit val debugDisabled = DeriveDebug.derived[Disabled.type]
DeriveDebug.derived[TasksServiceConfig]
}
val layer = ZLayer.fromFunction((_: AppConfig).tasksService)
}Or I could omit the leaf implicits, or I could write it more explicitly as
Debug.make {
case google: GoogleCloudTasks => google.debug
case Disabled => Disabled.debug
}Because Debug is contravariant, debugTasksServiceConfig is the implicit selected for a Debug[GoogleCloudTasks], leading to infinite recursion.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels