RustPython / RustPython/Parser

Visitor trait `visit_arg` is never called

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

Nobody has claimed this yet.

Dominant language
Rust
Stars
117
Forks
38
Avg merge
4d 7h
Merged PRs (30d)
1

Description

When using the Visitor trait I realized that the default values of arguments are never visited. This is because the visit_arg function is never actuall called:
https://github.com/RustPython/Parser/blob/4588ea5c3e6327009640e7c9c89eb6fa9220358e/ast/src/gen/visitor.rs#L737

I also could not see an implementation for visiting the default value of an arg.

Contributor guide

No contributing guide indexed for this repository

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.

Research direction

Start in ast/src/gen/visitor.rs around line 737, as linked in the issue, and inspect how Visitor handles function arguments and their default values. Trace the existing visit_arg path and determine how default expressions should be visited. Done means argument defaults are visited when using the Visitor trait, with coverage for the reported behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.