mirror of
https://github.com/mbierlee/poodinis.git
synced 2024-11-15 04:04:01 +01:00
Remove helpful compilation warning in favor of supporting more edge-cases out of the box
This commit is contained in:
parent
d7dc57ec99
commit
70b4c9e9dd
|
@ -1,5 +1,8 @@
|
|||
Poodinis Changelog
|
||||
==================
|
||||
**Version 8.1.0-beta.7**
|
||||
* REVERT fix for issue #31. It broke too many valid cases.
|
||||
|
||||
**Version 8.1.0-beta.6**
|
||||
* FIX multiple template arguments not allowed on constructor argument injection (PR #37)
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
Poodinis Dependency Injection Framework
|
||||
=======================================
|
||||
Version 8.1.0-beta.6
|
||||
Version 8.1.0-beta.7
|
||||
Copyright 2014-2021 Mike Bierlee
|
||||
Licensed under the terms of the MIT license - See [LICENSE.txt](LICENSE.txt)
|
||||
|
||||
|
|
|
@ -218,16 +218,6 @@ synchronized class DependencyContainer
|
|||
return newRegistration;
|
||||
}
|
||||
|
||||
public Registration register(SuperType, ConcreteType)(
|
||||
RegistrationOption options = RegistrationOption.none)
|
||||
if (!is(SuperType == ConcreteType) && !is(BaseTypeTuple!ConcreteType == AliasSeq!(Object,
|
||||
SuperType)) && !is(BaseTypeTuple!ConcreteType == AliasSeq!(SuperType)))
|
||||
{
|
||||
pragma(msg, "Cannot register dependency: ", ConcreteType,
|
||||
" is not derived from ", SuperType);
|
||||
static assert(0, "Cannot register dependency");
|
||||
}
|
||||
|
||||
private bool hasOption(OptionType)(OptionType options,
|
||||
OptionType persistentOptions, OptionType option)
|
||||
{
|
||||
|
|
|
@ -673,4 +673,14 @@ version (unittest)
|
|||
|
||||
assert(instance.preDestroyWasCalled == true);
|
||||
}
|
||||
|
||||
// Test register class by ancestor type
|
||||
unittest
|
||||
{
|
||||
auto container = new shared DependencyContainer();
|
||||
container.register!(Grandma, Kid);
|
||||
auto instance = container.resolve!Grandma;
|
||||
|
||||
assert(instance !is null);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -789,4 +789,19 @@ version (unittest)
|
|||
this.dependency = assignedDependency;
|
||||
}
|
||||
}
|
||||
|
||||
class Grandma
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
class Mommy : Grandma
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
class Kid : Mommy
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue