Skip to content

Is VisitBaseType internal field used consistently? #144

@IVNSTN

Description

@IVNSTN

While diving deep into debugging my app I accidentally have noticed this: TSqlFragmentVisitor final code contains many blocks which check of VisitBaseType internal field value and if it is true then Visit method for base types is called, but for some sql-fragment classes Visit method implementation has this check negated and the behavior is reversed:

    // Summary:
    //     Visitor for DeclareCursorStatement
    public virtual void Visit(DeclareCursorStatement node)
    {
        if (!VisitBaseType)     <<<--- here
        {
            Visit((TSqlFragment)node);
        }
    }

    //
    // Summary:
    //     Explicit Visitor for DeclareCursorStatement
    public virtual void ExplicitVisit(DeclareCursorStatement node)
    {
        if (VisitBaseType)
        {
            Visit((TSqlStatement)node);
            Visit((TSqlFragment)node);
        }

        Visit(node);
        node.AcceptChildren(this);
    }

Is this expected behavior? If so, please clarify what was the intent, how VisitBaseType should be understood.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions