Try
val discriminator: Expr[Int] = '{ $discriminatorCriteriaExpr.getFor[headType & A] }
or
case Some('{ $m: Mirror.SumOf[A] {type MirroredElemTypes = elemTypes} }) =>
'{ tag[elemTypes] } match {
case '{
type headType <: A
tag[`headType` *: tailTypes]
} =>
where
def tag[A] = ???
Explicit type conversion in Scala 3 macros
What Scala 3 syntax can match on a Type and its Type parameters in the context of a macro?