mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-04-18 01:42:50 +08:00
(#1313) fix mixing of Registrations
i.e. combining Register, RegisterInstance and RegisterLazy
This commit is contained in:
parent
ead7115cbe
commit
3da367f29f
@ -35,11 +35,12 @@ internal sealed class ComponentRegistry : IDisposable
|
||||
foreach (var type in new HashSet<Type>(registration.RegistrationTypes))
|
||||
{
|
||||
if (!_registrations.ContainsKey(type))
|
||||
{
|
||||
{
|
||||
// Only add each registration type once.
|
||||
_registrations.Add(type, new HashSet<ComponentRegistration>());
|
||||
_registrations[type].Add(registration);
|
||||
_registrations.Add(type, new HashSet<ComponentRegistration>());
|
||||
}
|
||||
|
||||
_registrations[type].Add(registration);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user