From cdc96ccb4cb84343c56e92befb259640619edc5a Mon Sep 17 00:00:00 2001 From: "Simon G." Date: Thu, 4 Dec 2025 07:59:53 +0100 Subject: [PATCH] - new constraint must be last --- .../FactoryGenerator.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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