Macros: knownDirectSubclasses broken with nested type?
问题 I have a macro which enumerates the direct sub types of a sealed trait: import scala.reflect.macros.Context import language.experimental.macros object Checker { def apply[A]: Unit = macro applyImpl[A] def applyImpl[A: c.WeakTypeTag](c: Context): c.Expr[Unit] = { val tpe = c.weakTypeOf[A].typeSymbol.asClass require (tpe.isSealed) tpe.typeSignature // SI-7046 require (tpe.knownDirectSubclasses.nonEmpty) import c.universe._ c.Expr[Unit](reify {} .tree) } } Then this works: sealed trait A case