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

Did you find this page helpful?