Commit 0c43cd0
fix: improve
This PR fixes `recall` to work inside namespaces and with `open` declarations, as reported on [Zulip](https://leanprover.zulipchat.com/#narrow/channel/287929-mathlib4/topic/recall.20doesn.27t.20work.20in.20namespaces/near/430877189).
Previously, `recall` used raw `id.getId` to extract the declaration name, which ignored the current namespace. Now it uses `resolveGlobalConstNoOverload`, the standard Lean name resolution function.
```lean
-- Previously failed with "Unknown constant 'myDef'"
namespace Foo
def myDef := 42
end Foo
namespace Foo
recall myDef : Nat -- now works
end Foo
-- Also works with `open`
open Foo in
recall myDef : Nat
```
🤖 Prepared with Claude Code
Co-authored-by: Kim Morrison <kim@tqft.net>recall impl / error reporting (leanprover-community#8740)1 parent 425c494 commit 0c43cd0
2 files changed
Lines changed: 14 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
| 55 | + | |
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
0 commit comments