JamitLabs/MungoHealer

Main class prevents all accesses through package name!

Opened this issue · 3 comments

jjorn commented

All package contents are not accessible through the package due to the name of the main class. For example, the class MungoError can still be accessed as long as no package name is defined; Accessing the class with package name MungoHealer.MungoError is always failed.

Thank for reporting the issue. Do you also have an idea how this can be fixed? Feel free to post a PR.

jjorn commented

@Dschee For a certain entity, we can just import it directly with swift default import declaration like

import protocol MungoHealer.BaseError

But in some cases, e.g. adding a new custom ErrorHandler, there is some efforts behind. A ton of related entities like BaseError, ... is required and has to be imported one-by-one.

For a long term solution, I prefer to rename the main class MungoHealer to Healer or something else that does not duplicate the package name. What do you think?

If that fixes the issue, I'm not against renaming MungoHealer (though I feel it's weird that we need to do this). I'd prefer Mungo over Healer though, since in the example code we also just name the global variable mungo – the type would fit then. Would you like to create a PR (and test if that actually solved the problem)?