leanprover-community / leanprover-community/lean
Relative import: problem with depth
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 433
- Forks
- 79
- PR merge metrics
- No merged PRs in 30d
Description
When trying to use relative imports, I realized that they did not work for files with more than 3 levels of subdirectories. Browing on Zulip, I found a message from Mario (from 2018!) saying the following:
I guess no one has ever tried to use 7 dots in a row in relative imports, but it doesn't work. The = should be a += here, and I tested that if you put import .......test it counts as only one level up (and in general k dots means k mod 3 levels up)
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.
Research direction
Start in src/frontends/lean/parser.cpp around line 2422, as linked in the issue, and trace how repeated dots are counted for relative imports. Reproduce the behavior with imports such as .......test, then verify that different dot counts resolve the expected number of parent directories and that the existing import tests still pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100