Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
varshith257 committed Sep 10, 2024
1 parent 040c58c commit 2d94557
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions zio-http/shared/src/main/scala/zio/http/Routes.scala
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,12 @@ final case class Routes[-Env, +Err](routes: Chunk[zio.http.Route[Env, Err]]) { s
def @@[Env0](aspect: HandlerAspect[Env0, Unit]): Routes[Env with Env0, Err] =
aspect(self)

def @@[Env0, Ctx <: Env](
aspect: HandlerAspect[Env0, Ctx],
)(implicit tag: Tag[Ctx]): Routes[Env0, Err] = {
val updatedRoutes = if (isScala2 && isIntersectionType[Ctx]) {
convertToTuple(self.transform(_ @@ aspect))
def @@[Env0, Ctx <: Env](aspect: HandlerAspect[Env0, Ctx])(implicit tag: Tag[Ctx]): Routes[Env0, Err] = {
if (isScala2 && isIntersectionType[Ctx]) {
self.transform(_ @@ aspect).asInstanceOf[Routes[Env0, Err]]
} else {
self.transform(_ @@ aspect)
}
updatedRoutes
}

def @@[Env0]: ApplyContextAspect[Env, Err, Env0] =
Expand Down

0 comments on commit 2d94557

Please sign in to comment.