Transpose static if to avoid generating dead code.

This commit is contained in:
Thayne McCombs 2016-06-26 21:00:15 -06:00
parent 6255292069
commit 4e27adc96b

View file

@ -175,8 +175,8 @@ synchronized class DependencyContainer {
auto newRegistration = new AutowiredRegistration!ConcreteType(registeredType, this); auto newRegistration = new AutowiredRegistration!ConcreteType(registeredType, this);
newRegistration.singleInstance(); newRegistration.singleInstance();
if (!hasOption(options, persistentRegistrationOptions, RegistrationOption.doNotAddConcreteTypeRegistration)) { static if (!is(SuperType == ConcreteType)) {
static if (!is(SuperType == ConcreteType)) { if (!hasOption(options, persistentRegistrationOptions, RegistrationOption.doNotAddConcreteTypeRegistration)) {
auto concreteTypeRegistration = register!ConcreteType; auto concreteTypeRegistration = register!ConcreteType;
concreteTypeRegistration.linkTo(newRegistration); concreteTypeRegistration.linkTo(newRegistration);
} }