Interface is allowed by initializedBy.

This commit is contained in:
heromyth 2021-05-04 09:45:17 +08:00 committed by Mike Bierlee
parent dcaa4d77be
commit 3a5d5bf214

View file

@ -130,7 +130,8 @@ public Registration existingInstance(Registration registration, Object instance)
/**
* Scopes registrations to create new instances using the given initializer delegate.
*/
public Registration initializedBy(T : Object)(Registration registration, T delegate() initializer)
public Registration initializedBy(T)(Registration registration, T delegate() initializer)
if(is(T == class) || is(T == interface))
{
registration.instanceFactory.factoryParameters = InstanceFactoryParameters(
registration.instanceType, CreatesSingleton.no, null, {