Пример #1
0
    public static ImplicitSingleStatementBranches TryGetIfStatementBranches_OverwritePrev(IfStatementSyntax syntax, ISemanticModel model, Assumptions assume)
    {
        var trueAction = syntax.Statement.CollapsedStatements().SingleOrDefaultAllowMany();
        if (trueAction == null) return null;

        if (syntax.Else != null) return null;
        var prev = syntax.TryGetPrevStatement();
        if (prev == null) return null;

        if (trueAction.EffectsOverwriteEffectsOf(prev, model, assume) != true) return null;
        return new ImplicitSingleStatementBranches(trueAction, prev, prev);
    }