Skip to content

Commit 830a6b0

Browse files
committed
Better way to coerce unit
1 parent 6c4b437 commit 830a6b0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

modules/smithy4s/src/main/scala/jsonrpclib/smithy4sinterop/ClientStub.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ private class ClientStub[Alg[_[_, _, _, _, _]], F[_]: Monadic](val service: Serv
5252
private object CoerceUnitVisitor extends (Schema ~> F) {
5353
def apply[A](schema: Schema[A]): F[A] = schema match {
5454
case s @ Schema.StructSchema(_, _, _, make) if s.isUnit =>
55-
Monadic[F].doPure(()).asInstanceOf[F[A]]
55+
Monadic[F].doPure(make(IndexedSeq.empty))
5656
case _ => Monadic[F].doRaiseError[A](NotUnitReturnType)
5757
}
5858
}

0 commit comments

Comments
 (0)