File tree Expand file tree Collapse file tree 2 files changed +27
-1
lines changed
Expand file tree Collapse file tree 2 files changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -204,7 +204,7 @@ private def elabDeclToUnfoldOrTheorem (config : Meta.ConfigWithKey) (id : Origin
204204
205205private def elabSimpTheorem (config : Meta.ConfigWithKey) (id : Origin) (stx : Syntax)
206206 (post : Bool) (inv : Bool) : TermElabM ElabSimpArgResult := do
207- let thm? ← Term.withoutModifyingElabMetaStateWithInfo <| withRef stx do
207+ let thm? ← Term.withoutModifyingElabMetaStateWithInfo <| withNewMCtxDepth <| withRef stx do
208208 let e ← Term.elabTerm stx .none
209209 Term.synthesizeSyntheticMVars (postpone := .no) (ignoreStuckTC := true )
210210 let e ← instantiateMVars e
Original file line number Diff line number Diff line change 1+ /-!
2+ # Test for issue 9286
3+ https://github.com/leanprover/lean4/issues/9286
4+
5+ Previously `simp` would create a type incorrect term.
6+ The proximal issue was that the universe level metavariable in the type `a` was being
7+ abstracted without abstracting `a` itself.
8+ However, we should not be abstracting `a`; instead, simp arguments should be elaborated
9+ with a new metacontext depth -- this is in part justified by the fact that elaboration
10+ of simp arguments should not be assigning metavariables.
11+ -/
12+
13+ inductive SomeThing. {u} : Prop where
14+ | mk (_ : PUnit.{u})
15+
16+ /-!
17+ Previously `simp` would succeed and lead to a kernel typechecking error.
18+ Now, `simp` correctly makes no progress.
19+ -/
20+ /-- error: `simp` made no progress -/
21+ #guard_msgs in
22+ set_option pp.universes true in
23+ def testMe (a : PUnit) : PLift SomeThing := by
24+ constructor
25+ have := SomeThing.mk a
26+ simp only [SomeThing.mk a]
You can’t perform that action at this time.
0 commit comments