diff --git a/source/poodinis/autowire.d b/source/poodinis/autowire.d index 066666a..bc3bd1d 100644 --- a/source/poodinis/autowire.d +++ b/source/poodinis/autowire.d @@ -270,7 +270,7 @@ class AutowiredRegistration(RegistrationType : Object) : Registration { enum QualifiedName = fullyQualifiedName!RegistrationType ~ `.` ~ memberName; static if (__traits(compiles, __traits(getProtection, __traits(getMember, instance, memberName))) && __traits(getProtection, __traits(getMember, instance, memberName)) == "public" - && isFunction1!(mixin(QualifiedName)) + && isFunction!(mixin(QualifiedName)) && hasUDA!(__traits(getMember, instance, memberName), PreDestroy)) { preDestructor = &__traits(getMember, instance, memberName); } diff --git a/source/poodinis/container.d b/source/poodinis/container.d index 4a78da4..eca6446 100644 --- a/source/poodinis/container.d +++ b/source/poodinis/container.d @@ -404,7 +404,7 @@ synchronized class DependencyContainer { enum QualifiedName = fullyQualifiedName!Type ~ `.` ~ memberName; static if (__traits(compiles, __traits(getProtection, __traits(getMember, instance, memberName))) && __traits(getProtection, __traits(getMember, instance, memberName)) == "public" - && isFunction1!(mixin(QualifiedName)) + && isFunction!(mixin(QualifiedName)) && hasUDA!(__traits(getMember, instance, memberName), PostConstruct)) { __traits(getMember, instance, memberName)(); } diff --git a/source/poodinis/polyfill.d b/source/poodinis/polyfill.d index 78347e9..e5a5813 100644 --- a/source/poodinis/polyfill.d +++ b/source/poodinis/polyfill.d @@ -43,24 +43,24 @@ static if (!__traits(compiles, basicExceptionCtors)) { } } -static if (!__traits(compiles, isFunction1)) { - template isFunction1(X...) +static if (!__traits(compiles, isFunction)) { + template isFunction(X...) { static if (X.length > 1) { - enum isFunction1 = false; + enum isFunction = false; } else static if (is(typeof(&X[0]) U : U*) && is(U == function) || is(typeof(&X[0]) U == delegate)) { // x is a (nested) function symbol. - enum isFunction1 = true; + enum isFunction = true; } else static if (is(X[0] T)) { // x is a type. Take the type of it and examine. - enum isFunction1 = is(T == function); + enum isFunction = is(T == function); } else - enum isFunction1 = false; + enum isFunction = false; } }