I have a package that contains a submodule. I can use that submodule directly, like:
using MyPackage.Submodule
Now, I want to use that submodule in another package, and thus this other package has MyPackage
as a dependency. Until there, all fine.
However, this other package starts with:
module MyOtherPackage
using MyPackage.Submodule
...
end
but I'm getting the Package MyOtherPackage does not have Submodule as a dependency
error.
Is there a standard way to deal with this kind of issue? Having a submodule that essentially can be loaded independently is such an extraneous thing?
Or, more simply. If I import MyPackage
instead (I don't want to bring into scope the exported names of MyPackage
):
module MyOtherPackage
import MyPackage
# how to bring into escope MyPackage.Submodule exported functions?
end
How can I then bring into scope the MyPackage.Submodule
exported functions without making Submodule
itself be interpreted as a directy dependency? Is there a workaround around that?
Ok, this works:
module MyOtherPackage
import MyPackage
using .MyPackage.Submodule
...
end
Leandro Martínez has marked this topic as resolved.
Last updated: Dec 28 2024 at 04:38 UTC