You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 25, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Feb 25, 2026. It is now read-only.
[Feature] ThrowHelper APIs with return values #3454
The new ThrowHelper APIs added in #3346 currently can't be used within switch statements or in cases where users need a return value from the invoked API in order to make the C# compiler happy. Consider this sample:
That throw can't be replaced with a ThrowHelper call, as they all return void. This forces users to either manually write a throw function, which is verbose and defeats the whole point of having the ThrowHelper APIs, or to leave the exception there and get terrible codegen, which again defeats the whole point of worrying about this in the first place.
Describe the solution
We should also offer overloads of all the ThrowHelper APIs with a dummy T return, so that devs can use them in cases like this.
The above example would become as follows:
Activity
Generic throw helper (#3455)