Is there a way in scala to get list of all objects(by object I mean scalas object) that derive from specified abstract class? something like that:
abstract class A
object B extends A //in different file
object C extends A //in different file
def findObjectsDerivingFromA(): Seq[A] //which will give result: Seq(B, C)
I know from here : Can I get a compile-time list of all of the case objects which derive from a sealed parent in Scala? that it's possible with sealed base trait/class but in my case objects B and C will be pretty complex so I need to have them in different files.
edit: I've changed method name because previous one was misleading.