C
C#10mo 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
cap5lut10mo ago
cap5lut
cap5lut10mo ago
as far as i know and from some searching there isnt any other attribute to specify such behaviour
reflectronic
reflectronic10mo ago
yeah, you cannot do this for general flow analysis the above attribute only affects nullable analysis, not definite assignment and such
Accord
Accord10mo 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.