mark method as throwing exception unconditionally #1291
Replies: 3 comments
-
#538 ? |
Beta Was this translation helpful? Give feedback.
-
So basically a |
Beta Was this translation helpful? Give feedback.
-
#538, I'm not sure. I'm mainly just looking for a way to avoid the need to put in an unreachable return statement in cases where the flow always leads to an exception in a called API. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I have diagnostics methods that unconditionally throw exceptions, which I often use in place of a direct throw statement. When a method that is declared to return a non-void result contains a throw, the compiler doesn't generate an error because the method doesn't return anything.
I would like to declare or mark methods that unconditionally throw an exception, to allow them to be used in lieu of throw, and have the compiler recognize that, and not generate an error because the method does not return a result.
Beta Was this translation helpful? Give feedback.
All reactions