diff --git a/source/poodinis/autowire.d b/source/poodinis/autowire.d index 942e5ee..648dacf 100644 --- a/source/poodinis/autowire.d +++ b/source/poodinis/autowire.d @@ -309,7 +309,7 @@ class AutowiredRegistration(RegistrationType : Object) : Registration { private void delegate() getPreDestructor(RegistrationType instance) { void delegate() preDestructor = null; static foreach (memberName; __traits(allMembers, RegistrationType)) { - static foreach (overload; __traits(getOverloads, instance, memberName)) { + static foreach (overload; __traits(getOverloads, RegistrationType, memberName)) { static if (__traits(compiles, __traits(getProtection, overload)) && __traits(getProtection, overload) == "public" && isFunction!overload diff --git a/source/poodinis/container.d b/source/poodinis/container.d index 5633950..883ba42 100644 --- a/source/poodinis/container.d +++ b/source/poodinis/container.d @@ -421,7 +421,7 @@ synchronized class DependencyContainer { private void callPostConstructors(Type)(Type instance) { static foreach (memberName; __traits(allMembers, Type)) { - static foreach (overload; __traits(getOverloads, instance, memberName)) { + static foreach (overload; __traits(getOverloads, Type, memberName)) { static if (__traits(compiles, __traits(getProtection, overload)) && __traits(getProtection, overload) == "public" && isFunction!overload diff --git a/source/poodinis/context.d b/source/poodinis/context.d index 522b539..c37e06e 100644 --- a/source/poodinis/context.d +++ b/source/poodinis/context.d @@ -65,7 +65,7 @@ public void registerContext(Context : ApplicationContext)(shared(DependencyConta public void registerContextComponents(ApplicationContextType : ApplicationContext)( ApplicationContextType context, shared(DependencyContainer) container) { foreach (memberName; __traits(allMembers, ApplicationContextType)) { - foreach (overload; __traits(getOverloads, context, memberName)) { + foreach (overload; __traits(getOverloads, ApplicationContextType, memberName)) { static if (__traits(getProtection, overload) == "public" && hasUDA!(overload, Component)) { auto factoryMethod = &__traits(getMember, context, memberName); Registration registration = null;