EndOfSentenceFormat - Fix #3893 by only calling super.visit once#3904
Conversation
In #3660 the EndOfSentenceFormat rule got refactored. The rule is called by the MultiRule 'KDocStyle'. Both the called and calling visitor function execute a super.visit(). This can cause problems. Hence, super.visit only called once with the changes made. Suspicion: Multiple KtDeclaration super.visit calls cause the crash in #3893.
Codecov Report
@@ Coverage Diff @@
## main #3904 +/- ##
============================================
+ Coverage 83.55% 83.58% +0.03%
- Complexity 3118 3122 +4
============================================
Files 456 456
Lines 8973 9012 +39
Branches 1746 1756 +10
============================================
+ Hits 7497 7533 +36
Misses 564 564
- Partials 912 915 +3
Continue to review full report at Codecov.
|
| deprecatedBlockTag.visitDeclaration(dcl) | ||
| endOfSentenceFormat.visitDeclaration(dcl) |
There was a problem hiding this comment.
Does deprecatedBlockTag and endOfSentenceFormat each invokes super.visitDeclaration(dcl), thus in total calling twice?
There was a problem hiding this comment.
Each rule calls its own super visit method. Before that, each rule called its own super visit method as well as the calling KDocStyle multi-rule.
There was a problem hiding this comment.
I assume that before this PR, KDocStyle.visitDeclaration() is called but DeprecatedBlockTag.visitDeclaration is not invoked at runtime.
|
Are we ok merging this? |
In #3660 the EndOfSentenceFormat rule got refactored.
The rule is called by the MultiRule 'KDocStyle'.
Both the called and calling visitor function execute a super.visit().
This can cause problems.
Hence, super.visit only called once with the changes made.
Suspicion:
Multiple KtDeclaration super.visit calls cause the crash in #3893.