lean4-htt/tests/elab/10771.lean
Garmelon 08eb78a5b2
chore: switch to new test/bench suite (#12590)
This PR sets up the new integrated test/bench suite. It then migrates
all benchmarks and some related tests to the new suite. There's also
some documentation and some linting.

For now, a lot of the old tests are left alone so this PR doesn't become
even larger than it already is. Eventually, all tests should be migrated
to the new suite though so there isn't a confusing mix of two systems.
2026-02-25 13:51:53 +00:00

53 lines
1.3 KiB
Text

module
import all Init.Prelude
/-!
# Pretty printing imported private names
https://github.com/leanprover/lean4/issues/10771
https://github.com/leanprover/lean4/issues/10772
https://github.com/leanprover/lean4/issues/10773
-/
/-!
This used to print `Lean.eraseMacroScopesAux✝ = Lean.eraseMacroScopesAux✝¹`.
-/
/-- info: Lean.eraseMacroScopesAux = Lean.eraseMacroScopesAux : Prop -/
#guard_msgs in
#check Lean.eraseMacroScopesAux = Lean.eraseMacroScopesAux
/-!
The first used to print `Lean.eraseMacroScopesAux✝`
-/
section
open Lean Name
/-- info: eraseMacroScopesAux : Name → Name -/
#guard_msgs in #check (eraseMacroScopesAux)
/-- info: eraseMacroScopes : Name → Name -/
#guard_msgs in #check (eraseMacroScopes)
end
/-!
This used to suggest `simp only [_private.Init.Prelude.0.Lean.eraseMacroScopesAux]`.
-/
/--
info: Try this:
[apply] simp only [Lean.eraseMacroScopesAux]
-/
#guard_msgs in
example : Lean.eraseMacroScopesAux .anonymous = .anonymous := by
simp? [Lean.eraseMacroScopesAux]
/-!
Fixing these issues involved rewriting how name unresolution handled macro scopes.
Here's a test that hygienic names can be unresolved too.
-/
macro "mk_struct" n:ident : command => `(
structure S where
def $n : S := {})
namespace NS
mk_struct T
/-- info: T : S✝ -/
#guard_msgs in #check (T)
end NS
/-- info: NS.T : NS.S✝ -/
#guard_msgs in #check (NS.T)