Reverse order in which we visit derived classes.#2264
Draft
Conversation
When invoking Node visitors we previously would visit from base class to most derived. For visitors accumulating information this was fine since for them order didn't matter. Matchers which should be invoked exactly once on the other hand were hard to implement since we would always invoke the most general matcher without even knowing whether a more specific one would also be invoked. This patch reverses the order we invoke handlers, now from most derived to base one. With additional state tracking this allows implementing skipping of more gerneral default handlers.
This code was already valid before, but coverity discovered different usage before and inferred that the dereferenced pointer could be null here as well. Add an `assert` to make clear that we expect it to be set.
rsmmr
reviewed
Feb 19, 2026
Member
There was a problem hiding this comment.
Have you looked at the baseline changes more closely? In particular these stand out to me:
- [debug/resolver] -> [D21] declaration::Type Bar::Bar1 | public type Bar1 = string; (bar.hlt:6:1-6:26)
+ [debug/resolver] -> [D21] declaration::Type <no-canon-id> | public type Bar1 = string; (bar.hlt:6:1-6:26)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.