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
I think that there are often times where one would like to throw an exception if a value is null, like in
null
public string { get { return _myString; } set { if (value!=null) _myString = value; throw new ArgumentNullException(); } }
When allowing to throw an exception in the ?? Operator then things could be less verbose, but also quite understandable to everyone.
??
public string { get { return _myString; } set { _myString = value ?? throw new ArgumentNullException(); } }
The text was updated successfully, but these errors were encountered:
Dupe of #5143 (see 3rd point under "allowed in only the following contexts").
Sorry, something went wrong.
Ah, I see that it is already completely written down in https://github.com/dotnet/roslyn/blob/future/docs/features/patterns.md. (Did my research, but didn't see the forrest because of all the trees ;-)
No branches or pull requests
I think that there are often times where one would like to throw an exception if a value is
null
, like inWhen allowing to throw an exception in the
??
Operator then things could be less verbose, but also quite understandable to everyone.The text was updated successfully, but these errors were encountered: