framework
framework copied to clipboard
Fix consistency issue with inject aliases and dependency factories
The following happens currently: The ConsoleTracer is registered by default, generating the dependency under token "Tracer". The ConsoleTracer implements Closeable as an alias, therefore also registering under that token. Now OpenTelementryServer does the same, but there the Tracer isn't a closeable. Now when during shutdown, we resolve all dependencies under the token "Closeable", the previously created alias resolves to the new Tracer, which isn't closeable and therefore won't fulfill the interface, leading to errors.
Generally, this behavior is true for all aliases and dependency factories overwriting already existing dependencies in a container