Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Is `VisitBaseType` internal field used consistently?

Open
#144 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
csharp
Domain
compilers

Research direction

Start at TSqlFragmentVisitor and compare the Visit and ExplicitVisit implementations, using DeclareCursorStatement and its VisitBaseType branches as the concrete example. Check the corresponding SQL-fragment visitor methods for the reversed condition and document whether the behavior is intentional and how VisitBaseType should be interpreted.

Written by the indexing model from the issue text.

Description

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.

Dominant language
GAP
Stars
277
Forks
43
Avg merge
6d 17h
Merged PRs (30d)
3

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/SqlScriptDOM

All issues in microsoft/SqlScriptDOM

Similar issues

More Compilers issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.