Using SonarAnalyzer.CSharp 7.16.0.8981 and SonarLint for VS 2019 4.12.0.0
Shortest reproduction I can manage, not actual use case.
bool blip = false;
try
{
var rnd = new System.Random();
if (rnd.Next() % 100 > 50) throw new Exception();
blip = true;
}
catch { /* Ignore */ }
if (blip) Console.WriteLine("blip");
S2589 is triggered for the last line claiming it’s always true despite the potentially thrown exception causing it to be false.
Possibly affects other data types, but I didn’t test them.