Skip to content

Commit

Permalink
fix: ignore implementationDetail hyps in rename_i (#5183)
Browse files Browse the repository at this point in the history
Closes #5176
  • Loading branch information
JLimperg authored Aug 27, 2024
1 parent 095c7b2 commit 4436638
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Lean/Elab/Tactic/BuiltinTactic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,8 @@ def renameInaccessibles (mvarId : MVarId) (hs : TSyntaxArray ``binderIdent) : Ta
match lctx.getAt? j with
| none => pure ()
| some localDecl =>
if localDecl.isImplementationDetail then
continue
let inaccessible := !(extractMacroScopes localDecl.userName |>.equalScope callerScopes)
let shadowed := found.contains localDecl.userName
if inaccessible || shadowed then
Expand Down
14 changes: 14 additions & 0 deletions tests/lean/run/5176.lean
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
class Foo where

class Bar extends Foo where
bar : True

def foo : Foo := {}

example [Bar] : Bar := {
foo with bar := by {
rename_i inst
guard_hyp inst : Bar
trivial
}
}

0 comments on commit 4436638

Please sign in to comment.