lean4 icon indicating copy to clipboard operation
lean4 copied to clipboard

Renaming does not correctly deal with namespaces

Open mhuisi opened this issue 2 years ago • 0 comments

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

  1. Use the MWE above.
  2. Rename Foo.
  3. 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.

mhuisi avatar Nov 21 '23 12:11 mhuisi