So if I understand this right, there are two different aspects:
- allowing whole-package exports to allow for “layering” as discussed above
- avoiding explicit forwarder generation for exports
Perhaps inline export somepackage.*
would be a natural way to signal an opt-in for “recompile all the things”, potentially without creating forwarders, so the compiler reliably can find all names to export at the expense of efficient incremental compilation. It seems logical to me as inline
in general means “more work at compile time”…
And when the compiler complains that export somepackage.*
is not allowed, it can hint about adding inline
in front and also explain that this might give longer compile times.
Question to someone with more compiler knowledge than me: would the above be feasible?