Autoformat code

This commit is contained in:
Mike Bierlee 2023-03-07 00:46:07 +03:00
parent dfac28102e
commit b8caa00be1
2 changed files with 45 additions and 29 deletions

View file

@ -222,4 +222,20 @@ version (unittest)
assert(componentA.instance is componentB); assert(componentA.instance is componentB);
assert(componentB.instance is componentA); assert(componentB.instance is componentA);
} }
// Test autowiring class where a method is marked with @Autowire does nothing
unittest
{
// It should also not show deprecation warning:
// Deprecation: `__traits(getAttributes)` may only be used for individual functions, not overload sets such as: `lala`
// the result of `__traits(getOverloads)` may be used to select the desired function to extract attributes from
auto container = new shared DependencyContainer();
container.register!AutowiredMethod;
auto instance = container.resolve!AutowiredMethod;
assert(instance !is null);
assert(instance.lala == 42);
assert(instance.lala(77) == 77);
}
} }