SonarSource/sonar-dotnet

Fix S1854 FP: Value used in finally should LiveIn for all try blocks

pavel-mikula-sonarsource opened this issue · 0 comments

Should not raise in complex scenarios related to Roslyn LVA:

public void UsedInFinally()
{
            int value = 42; // Noncompliant FP
            try
            {
                SomethingThatCanThrow();
                value = 0;
            }
            finally
            {
                Use(value);
            }
}