79642079

Date: 2025-05-28 11:13:00
Score: 2
Natty:
Report link

Try to use '{...} rather than '[...]

x.asType match {
  case '[t] => '{tag[t]} match {
    case '{type t1 <: S; tag[`t1`]} =>
      '{ apply[t] }.asExprOf[Any]
  }
// outside macro impl
def tag[A] = ???

In scala 3.6.4, how to call a polymorphic method with type bounds from inside a quoted expression?

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