Skip to content

Commit

Permalink
ConcreteType should be a class
Browse files Browse the repository at this point in the history
  • Loading branch information
Heromyth authored and Mike Bierlee committed Mar 29, 2020
1 parent e26be1f commit cad0200
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions source/poodinis/container.d
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,9 @@ synchronized class DependencyContainer {
/**
*
*/
Registration register(SuperType, ConcreteType : SuperType)(InjectionInitializer!ConcreteType creator,
RegistrationOption options = RegistrationOption.none) if (!is(ConcreteType == struct)) {
Registration register(SuperType, ConcreteType : SuperType)(InjectionInitializer!SuperType creator,
RegistrationOption options = RegistrationOption.none)
if (is(ConcreteType == class)) {

TypeInfo registeredType = typeid(SuperType);
TypeInfo_Class concreteType = typeid(ConcreteType);
Expand All @@ -221,7 +222,7 @@ synchronized class DependencyContainer {

InstanceFactory instanceFactory = new class InstanceFactory {
protected override Object createInstance() {
return creator();
return cast(Object)creator();
}
};

Expand Down

0 comments on commit cad0200

Please sign in to comment.