79607376

Date: 2025-05-05 17:30:30
Score: 2
Natty:
Report link

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?

Reasons:
  • Blacklisted phrase (1): ???
  • Probably link only (1):
  • Low length (0.5):
  • Has code block (-0.5):
  • Ends in question mark (2):
  • High reputation (-2):
Posted by: Dmytro Mitin