We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ad50269 commit 3094bfbCopy full SHA for 3094bfb
src/CommandLine/ParserResult.cs
@@ -67,17 +67,17 @@ public abstract class ParserResult<T>
67
internal ParserResult(IEnumerable<Error> errors, TypeInfo typeInfo)
68
{
69
this.tag = ParserResultType.NotParsed;
70
- this.typeInfo = typeInfo;
71
- Errors = errors;
+ this.typeInfo = typeInfo ?? TypeInfo.Create(typeof(T));
+ Errors = errors ?? new Error[0];
72
Value = default;
73
}
74
75
internal ParserResult(T value, TypeInfo typeInfo)
76
77
+ Value = value ?? throw new ArgumentNullException(nameof(value));
78
this.tag = ParserResultType.Parsed;
79
+ this.typeInfo = typeInfo ?? TypeInfo.Create(value.GetType());
80
Errors = new Error[0];
- Value = value;
81
82
83
/// <summary>
0 commit comments