`recall?` doesn't resolve names

Open
#16,433 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
Half a day
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active

Research direction

The bug is that recall? does not resolve short names inside a namespace, while recall does. Start by comparing how the two commands look up constants in the Lean 4 source, since the payload does not name a file. Reproduce with the snippet in the issue, where recall? foo fails but recall foo and recall? Foo.foo succeed. Done means recall? foo inside namespace Foo resolves like recall foo.

Written by the indexing model from the issue text.

Description

bug
Prerequisites
  • Check that your issue is not already filed:
    https://github.com/leanprover/lean4/issues
  • Reduce the issue to a minimal, self-contained, reproducible test case.
    Avoid dependencies to Mathlib or Batteries.
  • Test your test case against the latest nightly release, for example on
    https://live.lean-lang.org/#project=lean-nightly
    (You can also use the settings there to switch to “Lean nightly”)
  • When reporting a perceived soundness bug: Does it affect lake check --paranoid?
    If in doubt, please reach out on [email protected] for responsible disclosure.
Description

recall? fails with "Unknown constant" unless the constant is fully qualified. Plain recall does name resolution.

Steps to Reproduce
namespace Foo
def foo : Nat := 42
recall? foo -- Error: Unknown constant `foo`
recall? Foo.foo -- Ok
recall foo -- Ok
end Foo

https://live.lean-lang.org/#codez=HYQwtgpgzgDiDGEAEAxA9mgUAEwgMyTwyQC4kA5EAF1IF4kAWAJkwCcJ4QAbLgfkIxsO3PqgwA6IlgjBsYtEA&project=lean-nightly

Versions

Lean 4.37.0-nightly-2026-11-11
Target: x86_64-unknown-linux-gnu Linux

Impact

Add 👍 to issues you consider important. If others are impacted by this issue, please ask them to add 👍 to it.

Dominant language
Lean
Stars
10.3k
Forks
1.1k
Avg merge
19h 8m
Merged PRs (30d)
421

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from leanprover/lean4

All issues in leanprover/lean4

Similar issues

More DevTools issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.