Is `VisitBaseType` internal field used consistently?
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/SqlScriptDOM
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
microsoft/SqlScriptDOM#228 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
microsoft/SqlScriptDOM#183 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 56/100
microsoft/SqlScriptDOM#226 · 1 reaction ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
microsoft/SqlScriptDOM#225 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 58/100
microsoft/SqlScriptDOM#224 ·
All issues in microsoft/SqlScriptDOM
Similar issues
-
todo:perf
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
objectionary/eo#8894 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
objectionary/phie#154 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
objectionary/jeo-maven-plugin#1774 ·
-
Minor breakage w/ LLVM 7: `test_llvm.cpp: error: cannot convert 'llvm::Module' to 'llvm::Module*'` Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100