From 99579060d3ce9281423cfa0f23c0ce20f644fcec Mon Sep 17 00:00:00 2001 From: Mike Bierlee Date: Tue, 30 Dec 2014 18:29:32 +0100 Subject: [PATCH] Return resolved instances by qualifier type instead --- source/poodinis/dependency.d | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/poodinis/dependency.d b/source/poodinis/dependency.d index ceb3559..e01fe9f 100644 --- a/source/poodinis/dependency.d +++ b/source/poodinis/dependency.d @@ -81,7 +81,7 @@ class DependencyContainer { return resolve!(RegistrationType, RegistrationType)(); } - public RegistrationType resolve(RegistrationType, QualifierType : RegistrationType)() { + public QualifierType resolve(RegistrationType, QualifierType : RegistrationType)() { TypeInfo resolveType = typeid(RegistrationType); TypeInfo qualifierType = typeid(QualifierType); @@ -95,11 +95,11 @@ class DependencyContainer { } Registration registration = getQualifiedRegistration(resolveType, qualifierType, *candidates); - RegistrationType instance = cast(RegistrationType) registration.getInstance(); + QualifierType instance = cast(QualifierType) registration.getInstance(); if (!autowireStack.canFind(registration)) { autowireStack ~= registration; - this.autowire!(QualifierType)(cast(QualifierType)instance); + this.autowire!(QualifierType)(instance); autowireStack.popBack(); }