mirror of
https://github.com/mbierlee/poodinis.git
synced 2024-11-15 04:04:01 +01:00
ConcreteType should be a class
This commit is contained in:
parent
e26be1f439
commit
cad0200904
|
@ -204,8 +204,9 @@ synchronized class DependencyContainer {
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
Registration register(SuperType, ConcreteType : SuperType)(InjectionInitializer!ConcreteType creator,
|
Registration register(SuperType, ConcreteType : SuperType)(InjectionInitializer!SuperType creator,
|
||||||
RegistrationOption options = RegistrationOption.none) if (!is(ConcreteType == struct)) {
|
RegistrationOption options = RegistrationOption.none)
|
||||||
|
if (is(ConcreteType == class)) {
|
||||||
|
|
||||||
TypeInfo registeredType = typeid(SuperType);
|
TypeInfo registeredType = typeid(SuperType);
|
||||||
TypeInfo_Class concreteType = typeid(ConcreteType);
|
TypeInfo_Class concreteType = typeid(ConcreteType);
|
||||||
|
@ -221,7 +222,7 @@ synchronized class DependencyContainer {
|
||||||
|
|
||||||
InstanceFactory instanceFactory = new class InstanceFactory {
|
InstanceFactory instanceFactory = new class InstanceFactory {
|
||||||
protected override Object createInstance() {
|
protected override Object createInstance() {
|
||||||
return creator();
|
return cast(Object)creator();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue