diff --git a/CHANGES.md b/CHANGES.md index fdd3a7d..4f18ba0 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -6,6 +6,7 @@ Poodinis Changelog * DEPRECATE supplying register()'s registration options as variadic arguments. Use register(SuperType, ConcreteType)(RegistrationOption[]) instead. * ADD resolve options to container resolve() * ADD ability to register a type while resolving it. Use resolve option registerBeforeResolving +* FIX registration of application contexts with non-public members **Version 6.0.0** * CHANGE registration scopes are replaced by a single factory implementation. If you were not doing anything with the internal scope mechanism, you diff --git a/source/poodinis/context.d b/source/poodinis/context.d index 8893efa..8e27af8 100644 --- a/source/poodinis/context.d +++ b/source/poodinis/context.d @@ -44,8 +44,7 @@ struct Prototype {} public void registerContextComponents(ApplicationContextType : ApplicationContext)(ApplicationContextType context, shared(DependencyContainer) container) { foreach (member ; __traits(allMembers, ApplicationContextType)) { - static if (hasUDA!(__traits(getMember, context, member), Component)) { - + static if (__traits(getProtection, __traits(getMember, context, member)) == "public" && hasUDA!(__traits(getMember, context, member), Component)) { auto factoryMethod = &__traits(getMember, context, member); Registration registration = null; auto createsSingleton = CreatesSingleton.yes;