diff --git a/core/src/main/scala-3/sttp/tapir/typelevel/IntersectionTypeMirror.scala b/core/src/main/scala-3/sttp/tapir/typelevel/IntersectionTypeMirror.scala index cb218f056f..ac7624b2fa 100644 --- a/core/src/main/scala-3/sttp/tapir/typelevel/IntersectionTypeMirror.scala +++ b/core/src/main/scala-3/sttp/tapir/typelevel/IntersectionTypeMirror.scala @@ -20,7 +20,8 @@ object IntersectionTypeMirror { private def derivedImpl[A](using Quotes, Type[A]): Expr[IntersectionTypeMirror[A]] = { import quotes.reflect.* - val tplPrependType = TypeRepr.of[? *: ?] + val tplPrependType = TypeRepr.of[? *: ?] match + case AppliedType(tycon, _) => tycon val tplConcatType = TypeRepr.of[Tuple.Concat] def prependTypes(head: TypeRepr, tail: TypeRepr): TypeRepr = diff --git a/core/src/main/scala-3/sttp/tapir/typelevel/UnionTypeMirror.scala b/core/src/main/scala-3/sttp/tapir/typelevel/UnionTypeMirror.scala index db42092662..e634a8b5d2 100644 --- a/core/src/main/scala-3/sttp/tapir/typelevel/UnionTypeMirror.scala +++ b/core/src/main/scala-3/sttp/tapir/typelevel/UnionTypeMirror.scala @@ -21,7 +21,8 @@ object UnionTypeMirror { private def derivedImpl[A](using Quotes, Type[A]): Expr[UnionTypeMirror[A]] = { import quotes.reflect.* - val tplPrependType = TypeRepr.of[? *: ?] + val tplPrependType = TypeRepr.of[? *: ?] match + case AppliedType(tycon, _) => tycon val tplConcatType = TypeRepr.of[Tuple.Concat] def prependTypes(head: TypeRepr, tail: TypeRepr): TypeRepr =