mirror of
https://github.com/mbierlee/poodinis.git
synced 2024-11-15 04:04:01 +01:00
Fix aliases tripping up UDA discovery
This commit is contained in:
parent
6a1fa7e2c1
commit
3d9a449766
|
@ -265,7 +265,8 @@ class AutowiredRegistration(RegistrationType : Object) : Registration {
|
||||||
private void delegate() getPreDestructor(RegistrationType instance) {
|
private void delegate() getPreDestructor(RegistrationType instance) {
|
||||||
void delegate() preDestructor = null;
|
void delegate() preDestructor = null;
|
||||||
foreach (memberName; __traits(allMembers, RegistrationType)) {
|
foreach (memberName; __traits(allMembers, RegistrationType)) {
|
||||||
static if (__traits(getProtection, __traits(getMember, instance, memberName)) == "public"
|
static if (__traits(compiles, __traits(getProtection, __traits(getMember, instance, memberName)))
|
||||||
|
&& __traits(getProtection, __traits(getMember, instance, memberName)) == "public"
|
||||||
&& isCallable!(__traits(getMember, instance, memberName))
|
&& isCallable!(__traits(getMember, instance, memberName))
|
||||||
&& hasUDA!(__traits(getMember, instance, memberName), PreDestroy)) {
|
&& hasUDA!(__traits(getMember, instance, memberName), PreDestroy)) {
|
||||||
preDestructor = &__traits(getMember, instance, memberName);
|
preDestructor = &__traits(getMember, instance, memberName);
|
||||||
|
|
|
@ -391,7 +391,8 @@ synchronized class DependencyContainer {
|
||||||
|
|
||||||
private void callPostConstructors(Type)(Type instance) {
|
private void callPostConstructors(Type)(Type instance) {
|
||||||
foreach (memberName; __traits(allMembers, Type)) {
|
foreach (memberName; __traits(allMembers, Type)) {
|
||||||
static if (__traits(getProtection, __traits(getMember, instance, memberName)) == "public"
|
static if (__traits(compiles, __traits(getProtection, __traits(getMember, instance, memberName)))
|
||||||
|
&& __traits(getProtection, __traits(getMember, instance, memberName)) == "public"
|
||||||
&& isCallable!(__traits(getMember, instance, memberName))
|
&& isCallable!(__traits(getMember, instance, memberName))
|
||||||
&& hasUDA!(__traits(getMember, instance, memberName), PostConstruct)) {
|
&& hasUDA!(__traits(getMember, instance, memberName), PostConstruct)) {
|
||||||
__traits(getMember, instance, memberName)();
|
__traits(getMember, instance, memberName)();
|
||||||
|
|
Loading…
Reference in a new issue