How can I reflect over package hierarchies in Scala 2.10's reflection? Can I find out what subpackages exist, or what the parent packages are?
Asked
Active
Viewed 537 times
1 Answers
4
Since in general case it's impossible to enumerate packages in a classloader, Scala reflection also doesn't provide this capability. This is unlike the situation with scalac, which is fed a list of directories, which can be enumerated.
Traversing up the hierarchy is easy. Just use symbol.owner
.

Eugene Burmako
- 13,028
- 1
- 46
- 59
-
Are there any changes in Scala 2.12? Are there any possibilities to get sub-packages? – falcon May 04 '18 at 15:33