diff --git a/LightweightIocContainer.FactoryGenerator/FactoryGenerator.cs b/LightweightIocContainer.FactoryGenerator/FactoryGenerator.cs index a09c06e..d6b036b 100644 --- a/LightweightIocContainer.FactoryGenerator/FactoryGenerator.cs +++ b/LightweightIocContainer.FactoryGenerator/FactoryGenerator.cs @@ -336,9 +336,6 @@ public class FactoryGenerator : IIncrementalGenerator if (typeParameterSymbol.HasValueTypeConstraint) constraints.Add("struct"); - if (typeParameterSymbol.HasConstructorConstraint) - constraints.Add("new()"); - if (typeParameterSymbol.HasUnmanagedTypeConstraint) constraints.Add("unmanaged"); @@ -353,6 +350,9 @@ public class FactoryGenerator : IIncrementalGenerator constraints.Add(constraintType.Name); } + if (typeParameterSymbol.HasConstructorConstraint) + constraints.Add("new()"); + return constraints; } } \ No newline at end of file