Currently, when dependencies are misconfigured and have a dependency cycle, the Injector class will just fill up the Stack until an Exception is thrown (which won't suggest what was wrong).
It would be super nice if you could detect such dependency cycles and print the users a nice message.
As far as I see it, this has to be done during getDependency. This function needs to keep track of its own stack and prevent entering the function twice for the same type in the same call stack.
Maybe I could file a PR in the next week about this 🤔
Currently, when dependencies are misconfigured and have a dependency cycle, the Injector class will just fill up the Stack until an Exception is thrown (which won't suggest what was wrong). It would be super nice if you could detect such dependency cycles and print the users a nice message.
As far as I see it, this has to be done during
getDependency
. This function needs to keep track of its own stack and prevent entering the function twice for the same type in the same call stack.Maybe I could file a PR in the next week about this 🤔