feat: Set root when there's just one mvar

This commit is contained in:
Leni Aniva 2024-09-09 17:37:59 -07:00
parent f729a357b9
commit fe8b259e4f
Signed by: aniva
GPG Key ID: 4D9B1C8D10EA4C50
1 changed files with 5 additions and 1 deletions

View File

@ -179,7 +179,11 @@ def sorrysToGoalState (sorrys : List Elab.TermInfo) : MetaM GoalState := do
let type := termInfo.expectedType?.get! let type := termInfo.expectedType?.get!
let mvar ← Meta.mkFreshExprSyntheticOpaqueMVar type let mvar ← Meta.mkFreshExprSyntheticOpaqueMVar type
return mvar.mvarId! 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