File tree Expand file tree Collapse file tree 1 file changed +2
-8
lines changed
Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Original file line number Diff line number Diff line change @@ -555,17 +555,10 @@ private def processConstructor (p : Problem) : MetaM (Array Problem) := do
555555 | _ => unreachable!
556556 return { mvarId := subgoal.mvarId, vars := newVars, alts := newAlts, examples := examples }
557557
558- private def altsAreCtorLike (p : Problem) : MetaM Bool := withGoalOf p do
559- pure (hasCtorPattern p) <&&>
560- p.alts.allM fun alt => do match alt.patterns with
561- | .ctor .. :: _ => return true
562- | .inaccessible e :: _ => isConstructorApp e
563- | _ => return false
564-
565558private def processNonVariable (p : Problem) : MetaM Problem := withGoalOf p do
566559 let x :: xs := p.vars | unreachable!
567560 if let some (ctorVal, xArgs) ← withTransparency .default <| constructorApp'? x then
568- if (← altsAreCtorLike p) then
561+ if hasCtorPattern p then
569562 let alts ← p.alts.filterMapM fun alt => do
570563 match alt.patterns with
571564 | .ctor ctorName _ _ fields :: ps =>
@@ -574,6 +567,7 @@ private def processNonVariable (p : Problem) : MetaM Problem := withGoalOf p do
574567 else
575568 return some { alt with patterns := fields ++ ps }
576569 | .inaccessible _ :: _ => processInaccessibleAsCtor alt ctorVal.name
570+ | .var _ :: _ => expandVarIntoCtor? alt ctorVal.name
577571 | _ => unreachable!
578572 let xFields := xArgs.extract ctorVal.numParams xArgs.size
579573 return { p with alts := alts, vars := xFields.toList ++ xs }
You can’t perform that action at this time.
0 commit comments