mirror of
https://github.com/mbierlee/poodinis.git
synced 2024-11-15 04:04:01 +01:00
Fix unnecessary re-registration of types when registerBeforeResolving is specified
This commit is contained in:
parent
e1cb511178
commit
f7578d79a3
|
@ -1,5 +1,9 @@
|
||||||
Poodinis Changelog
|
Poodinis Changelog
|
||||||
==================
|
==================
|
||||||
|
|
||||||
|
**Version NEXT**
|
||||||
|
* FIX unnecessary re-registration of types when registerBeforeResolving is specified.
|
||||||
|
|
||||||
**Version 8.1.2**
|
**Version 8.1.2**
|
||||||
* FIX compilation error on importing template types that are not actually types.
|
* FIX compilation error on importing template types that are not actually types.
|
||||||
|
|
||||||
|
|
|
@ -343,18 +343,19 @@ synchronized class DependencyContainer
|
||||||
writeln("DEBUG: Resolving type " ~ resolveType.toString() ~ " with qualifier " ~ qualifierType.toString());
|
writeln("DEBUG: Resolving type " ~ resolveType.toString() ~ " with qualifier " ~ qualifierType.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
static if (__traits(compiles, new QualifierType()))
|
auto candidates = resolveType in registrations;
|
||||||
|
if (!candidates)
|
||||||
{
|
{
|
||||||
if (hasOption(resolveOptions, persistentResolveOptions,
|
if (hasOption(resolveOptions, persistentResolveOptions,
|
||||||
ResolveOption.registerBeforeResolving))
|
ResolveOption.registerBeforeResolving))
|
||||||
|
{
|
||||||
|
static if (__traits(compiles, new QualifierType()))
|
||||||
{
|
{
|
||||||
register!(RegistrationType, QualifierType)();
|
register!(RegistrationType, QualifierType)();
|
||||||
|
return resolve!(RegistrationType, QualifierType)(resolveOptions);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
auto candidates = resolveType in registrations;
|
|
||||||
if (!candidates)
|
|
||||||
{
|
|
||||||
if (hasOption(resolveOptions, persistentResolveOptions,
|
if (hasOption(resolveOptions, persistentResolveOptions,
|
||||||
ResolveOption.noResolveException))
|
ResolveOption.noResolveException))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue