We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Expressions like true ? 1 : null currently throw an exception:
true ? 1 : null
error CS0173: Type of conditional expression cannot be determined because there is no implicit conversion between 'int' and '<null>'
Therefore, the codebase I inherited contains many instances of:
Housenumber = int.TryParse(organization.HouseNumber, out var parsed) ? parsed : default(int?)
or
Housenumber = int.TryParse(organization.HouseNumber, out var parsed) ? (int?)parsed : null
Housenumber = int.TryParse(organization.HouseNumber, out var parsed) ? parsed : (int?)null
I'd like to be able to write:
Housenumber = int.TryParse(organization.HouseNumber, out var parsed) ? parsed : null
The text was updated successfully, but these errors were encountered:
Duplicate of #33 / #2460 / #2823
Sorry, something went wrong.
No branches or pull requests
Expressions like
true ? 1 : null
currently throw an exception:error CS0173: Type of conditional expression cannot be determined because there is no implicit conversion between 'int' and '<null>'
Therefore, the codebase I inherited contains many instances of:
or
or
I'd like to be able to write:
The text was updated successfully, but these errors were encountered: