Currently there is no way to replace a type with another type if this type is currently used as a dependency. Adding a replacement would lead to an AmbiguousRequiredDependencyException while first removing the existing type would lead to an UnsatisfiedRequiredDependencyException. It should not be impossible to allow for an addition and removal simultaneously with the end result still satisfying all required dependencies.
This may have a use case during testing where a registered bean may be replaced completely with a mock.
Currently there is no way to replace a type with another type if this type is currently used as a dependency. Adding a replacement would lead to an
AmbiguousRequiredDependencyExceptionwhile first removing the existing type would lead to anUnsatisfiedRequiredDependencyException. It should not be impossible to allow for an addition and removal simultaneously with the end result still satisfying all required dependencies.This may have a use case during testing where a registered bean may be replaced completely with a mock.