Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do deeper traversal #7

Closed
wants to merge 1 commit into from
Closed

Conversation

lucacasonato
Copy link
Member

Fixes #5

There are some annoyances with how Rust's default trait method inheritance works. Implementing the one of AstTraverser methods in the rule will override the default trait method, and thus stop walking. Because Rust has no way to call the default trait method from an implementor (https://www.reddit.com/r/rust/comments/3uvfgx/how_to_call_default_trait_method/), the implementor will have to copy and paste the default trait code into their method (or we change the structure of AstTraverser to have a walk_* and super_walk_* method, where the default of walk_* is to call super_walk_*), to not stop the traversal. This is especially annoying for expressions, because they can be deeply nested in each other.

@bartlomieju
Copy link
Member

We setup CLA checker, please open a new PR

@lucacasonato lucacasonato mentioned this pull request Mar 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[bug] walk_expression is only called for top level expressions.
2 participants