C
C#15mo ago
CrosRoad95

❔ how can i tell analyzer that function will always throw?

i want to do something like:
MyException.Throw(); // void Throw() => throw new Exception();
MyException.Throw(); // void Throw() => throw new Exception();
how can i tell analyzer, that code after that method won't be reachable?
4 Replies
cap5lut
cap5lut15mo ago
cap5lut
cap5lut15mo ago
as far as i know and from some searching there isnt any other attribute to specify such behaviour
reflectronic
reflectronic15mo ago
yeah, you cannot do this for general flow analysis the above attribute only affects nullable analysis, not definite assignment and such
Accord
Accord15mo ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server