-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Move throw calls inside ThrowHelper.Get*
methods
#59378
Comments
Tagging subscribers to this area: @eiriktsarpalis, @layomia Issue DetailsI believe that's indeed the point. We may need a pass at the reader/writer Originally posted by @layomia in #55564 (comment)
|
For reference, the typical convention is to have Get* methods return an runtime/src/libraries/System.Private.CoreLib/src/System/ThrowHelper.cs Lines 228 to 232 in fd5b60f
|
What are the use cases for exposing Get* methods? All cases I'm aware of involve throwing the instance straight away. |
Maybe for wrapping exceptions? I agree it's atypical. |
ThrowHelper.Get*
methodaThrowHelper.Get*
methods
One use case seems to be calling throw helpers inside expressions, using a |
I believe that's indeed the point. We may need a pass at the reader/writer
ThrowHelper
implementation to throw inline rather than return exceptions, assuming there have been no JIT changes that render the optimization redundant.Originally posted by @layomia in #55564 (comment)
The text was updated successfully, but these errors were encountered: