We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents d0bf530 + 2da8209 commit a9243e9Copy full SHA for a9243e9
src/CommandLine/Infrastructure/ReflectionHelper.cs
@@ -79,11 +79,8 @@ public static bool IsFSharpOptionType(Type type)
79
80
public static T CreateDefaultImmutableInstance<T>(Type[] constructorTypes)
81
{
82
- var t = typeof(T);
83
- var ctor = t.GetTypeInfo().GetConstructor(constructorTypes);
84
- var values = (from prms in ctor.GetParameters()
85
- select prms.ParameterType.CreateDefaultForImmutable()).ToArray();
86
- return (T)ctor.Invoke(values);
+ var t = typeof(T);
+ return (T)CreateDefaultImmutableInstance(t, constructorTypes);
87
}
88
89
public static object CreateDefaultImmutableInstance(Type type, Type[] constructorTypes)
0 commit comments