Skip to content

Commit

Permalink
fix regression (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
alterationx10 committed Jul 27, 2023
1 parent ed25efa commit 8918100
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions opinions/src/main/scala/opinions/ZIO.scala
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,18 @@ object AutoLayer:
l.flatMap(_l => z.map(_z => _l :+ _z)),
)

val a: ZIO[IAnyType[p.MirroredElemTypes], Nothing, A] =
flattened.map(deps => p.fromProduct(Tuple.fromArray(deps.toArray)))
// Cast deps to List[Object], since toArray needs ClassTag.
// This fix works against Scala 3.3.2-RC1-bin-20230720-98b452d-NIGHTLY
// See:
// https://github.com/alterationx10/opinionated-zio/issues/7
// https://github.com/lampepfl/dotty/issues/18277
val a: ZIO[IAnyType[p.MirroredElemTypes], Nothing, A] = {
flattened.map { deps =>
p.fromProduct {
Tuple.fromArray(deps.asInstanceOf[List[Object]].toArray)
}
}
}

new AutoLayer[A]:
override def zlayer(using
Expand Down

0 comments on commit 8918100

Please sign in to comment.