lean4-htt/tests/elab/10172.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

33 lines
923 B
Text

/-!
# Rewrite tactic "steals" goals
-/
/-!
https://github.com/leanprover/lean4/issues/10172
There were two metaprogramming bugs:
- `rw` didn't filter old vs new metavariables when coming up with new goals.
- it also didn't make the new metavariables be synthetic opaque, so the old one was
being assigned, even with old vs new filtering.
-/
example (l m : List Nat) (i : Nat) (hi' : i < (l ++ m).length)
(hh : ∀ hi, l[i]'hi = 5) : (l ++ m)[i] = 5 := by
rw [List.getElem_append_left]
· rw [hh] -- used to be Error: unsolved goal `i < l.length`
· sorry -- used to be Error: No goals to be solved
/-!
While we're here, we could address a missing occurs check.
https://leanprover.zulipchat.com/#narrow/channel/270676-lean4/topic/rewrite.20with.20the.20goal/near/538108360
-/
/--
error: Occurs check failed: Expression
?k
contains the goal ?k
-/
#guard_msgs in
example : 1 = 2 := by
refine ?k
rw [?k]