mirror of
https://github.com/mbierlee/poodinis.git
synced 2024-11-15 04:04:01 +01:00
Fix always polyfilling isFunction
This commit is contained in:
parent
eaac0eb7ce
commit
de5fe524a0
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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)();
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue