What I think you want here is a simple require "types/user"
at the top of your resolver file.
It’s important to remember that dry-system’s auto-registration functionality is intended as a way to fill your container with registrations based on the files in your source directories. While it does so happen to require
those files as part of completing that job, requiring the files is not its primary purpose.
Our recommendation for people using dry-system is to “require what you require”. So if you’re needing to access some piece of code (i.e. refer to a constant, in your case, Types::User
) that is not an injected dependency, you should require it explicitly. This is especially important for you to be able to resolve a registration from a non-finalized container (when auto-registration hasn’t run) and have everything work as it should. This is the kind of thing you’d do when running your tests.
Let me know if that all makes sense