Bundling scopes for import

I would like to make the definitions from several different scopes importable through a single import. Some of the scopes are packages, others are objects.

Is there a way, perhaps by adding export statements somewhere, to make all the scopes accessible through a single import statement?

For example, let’s say I have packages a, b, and object C in a. Here is how they currently would have to be imported:

import a.*
import a.C.{*, given}
import b.{*, given}

I would like something like

import ???.{*, given}

to work, for some path ???, without having to change the package structure.

For a “real-world example”, see here.

For objects, that’s possible via exports, but for packages it’s not. Reason is that export generates forwarders and it’s hard to track dependencies in incremental compilation for wildcard im/exports.

See this discussion.

1 Like

Thank you!

If you happen to have any idea on how to improve the package organization of my project, let me know. I cannot get the number of imports needed below three without merging namespaces I’d rather keep separate.