Renaming does not correctly deal with namespaces
Nobody has claimed this yet.
- Dominant language
- Lean
- Stars
- 9.2k
- Forks
- 990
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 175
Description
Description
#2462 added support for renaming, but the current implementation does not correctly deal with namespaces:
namespace Bar
structure Foo where
a : Nat
def foobar (f : Foo) : Foo := f
end Bar
def foobar (f : Bar.Foo) : Bar.Foo := f
Renaming Foo here breaks references to Bar.Foo. Similarly, when you rename a type, it does not rename the corresponding namespace, leading to errors because dot notation is suddenly broken for a lot of functions.
Context
Prior discussion in the review comments for #2462.
Steps to Reproduce
- Use the MWE above.
- Rename
Foo. - Observe incorrect renaming behaviour.
Expected behavior: Renaming is aware of namespaces.
Actual behavior: Renaming is not aware of namespaces.
Versions
Commit b97b0ad2aaea49a2db3ac0543443ec72bd97dfdc
Impact
Add 👍 to issues you consider important. If others are impacted by this issue, please ask them to add 👍 to it.
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 with the renaming implementation introduced by #2462 and review the discussion in that change. Reproduce the issue using the MWE, then trace how references to Bar.Foo and its corresponding namespace are handled; done means renaming preserves those references and dot notation without errors.
Written by the indexing model from the issue text.
Assessment
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100