From fe8b259e4f09817bf4b2df269d87e836d10155cf Mon Sep 17 00:00:00 2001 From: Leni Aniva Date: Mon, 9 Sep 2024 17:37:59 -0700 Subject: [PATCH] feat: Set root when there's just one mvar --- Pantograph/Frontend/Elab.lean | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Pantograph/Frontend/Elab.lean b/Pantograph/Frontend/Elab.lean index 2ff9a2e..4d6afe4 100644 --- a/Pantograph/Frontend/Elab.lean +++ b/Pantograph/Frontend/Elab.lean @@ -179,7 +179,11 @@ def sorrysToGoalState (sorrys : List Elab.TermInfo) : MetaM GoalState := do let type := termInfo.expectedType?.get! let mvar ← Meta.mkFreshExprSyntheticOpaqueMVar type return mvar.mvarId! - GoalState.createFromMVars goals (root := { name := .anonymous }) + let root := match goals with + | [] => panic! "This function cannot be called on an empty list" + | [g] => g + | _ => { name := .anonymous } + GoalState.createFromMVars goals root