lean4
lean4 copied to clipboard
Renaming does not correctly deal with namespaces
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 :+1: to issues you consider important. If others are impacted by this issue, please ask them to add :+1: to it.