diff --git a/source/poodinis/autowire.d b/source/poodinis/autowire.d index 2ca4b21..f21c1a3 100644 --- a/source/poodinis/autowire.d +++ b/source/poodinis/autowire.d @@ -129,7 +129,7 @@ private void autowireMember(string member, size_t memberIndex, Type)(shared(Depe foreach(attribute; __traits(getAttributes, Type.tupleof[memberIndex])) { static if (is(attribute == Autowire!T, T)) { injectInstance!(member, memberIndex, typeof(attribute.qualifier))(container, instance); - } else if (__traits(isSame, attribute, Autowire)) { + } else static if (__traits(isSame, attribute, Autowire)) { injectInstance!(member, memberIndex, UseMemberType)(container, instance); } }