Skip to content

Commit 675d4b7

Browse files
committed
Merge branch 'master' into develop
2 parents 5343c5d + a9243e9 commit 675d4b7

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ __This library provides _hassle free_ command line parsing with a constantly upd
2727
- Supports `--help`, `--version`, `version` and `help [verb]` by default.
2828
- Map to sequences (via `IEnumerable<T>` and similar) and scalar types, including Enums and `Nullable<T>`.
2929
- You can also map to every type with a constructor that accepts a string (like `System.Uri`).
30-
- Define [verb commands](https://github.com/commandlineparser/commandline/wiki#verbs) similar to `git commit -a`.
30+
- Define [verb commands](https://github.com/commandlineparser/commandline/wiki/Verbs) similar to `git commit -a`.
3131
- Unparsing support: `CommandLine.Parser.Default.FormatCommandLine<T>(T options)`.
3232
- CommandLineParser.FSharp package is F#-friendly with support for `option<'a>`, see [demo](https://github.com/commandlineparser/commandline/blob/master/demo/fsharp-demo.fsx). _NOTE: This is a separate NuGet package._
3333
- Most of features applies with a [CoC](http://en.wikipedia.org/wiki/Convention_over_configuration) philosophy.

src/CommandLine/Infrastructure/ReflectionHelper.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,8 @@ public static bool IsFSharpOptionType(Type type)
7979

8080
public static T CreateDefaultImmutableInstance<T>(Type[] constructorTypes)
8181
{
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);
82+
var t = typeof(T);
83+
return (T)CreateDefaultImmutableInstance(t, constructorTypes);
8784
}
8885

8986
public static object CreateDefaultImmutableInstance(Type type, Type[] constructorTypes)

0 commit comments

Comments
 (0)