Get the module symbol, given I have the module class, scala macro
问题 I'm trying to build a simple typeclass IsEnum[T] using a macro. I use knownDirectSubclasses to get all the direct subclasses if T , ensure T is a sealed trait, and that all subclasses are of case objects (using subSymbol.asClass.isModuleClass && subSymbol.asClass.isCaseClass ). Now I'm trying to build a Seq with the case objects referred by the subclasses. It's working, using a workaround: Ident(subSymbol.asInstanceOf[scala.reflect.internal.Symbols#Symbol].sourceModule.asInstanceOf[Symbol])