-
Notifications
You must be signed in to change notification settings - Fork 480
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nullable type #305
Comments
if you defined an option as nullable like:
When 0 is passed in the command line: For Nullable , 0 isn't the default value. BTW, the default value of a nullable type is an instance for which the HasValue property is false and the Value property is undefined.
|
@moh-hassan I am running into the same issue. @Jaidsuka is pointing to the Using your above example, having an option defined as:
Calling This means that anyone relying on |
PR is welcome to fix this issue. |
How about something like this? This is also helping with the issue 379:
NOTICE: I removed "#if !SKIP_FSHARP" and "#endif" because this comment was being formatted as text. |
@nemars I don't think that will work. |
That's why I put both value and type as parameters. This is called only in one place in the code and the type can easily be acquired before that call. pi => new { |
online demo to show the fix in v2.7+ |
IsEmpty method doesn't work right in case when we use Nullable type as option. In this case when we pass 0 to parameter it won't add this option to command line back because think that default value for it will be 0 too. Nullable<'int'>.GetType() == typeof(int). IsEmpty method should be changed for covering that problem.
The text was updated successfully, but these errors were encountered: