@@ -759,13 +759,13 @@ end ToDepElimPattern
759759def withDepElimPatterns (patternVarDecls : Array PatternVarDecl) (ps : Array Expr) (matchType : Expr) (k : Array LocalDecl → Array Pattern → Expr → TermElabM α) : TermElabM α := do
760760 ToDepElimPattern.main patternVarDecls ps matchType k
761761
762- private def withElaboratedLHS {α} (ref : Syntax) ( patternVarDecls : Array PatternVarDecl) (patternStxs : Array Syntax) (lhsStx : Syntax) (numDiscrs : Nat) (matchType : Expr)
762+ private def withElaboratedLHS {α} (patternVarDecls : Array PatternVarDecl) (patternStxs : Array Syntax) (lhsStx : Syntax) (numDiscrs : Nat) (matchType : Expr)
763763 (k : AltLHS → Expr → TermElabM α) : ExceptT PatternElabException TermElabM α := do
764764 let (patterns, matchType) ← withSynthesize <| withRef lhsStx <| elabPatterns patternStxs numDiscrs matchType
765765 id (α := TermElabM α) do
766766 trace[Elab.match] "patterns: {patterns}"
767767 withDepElimPatterns patternVarDecls patterns matchType fun localDecls patterns matchType => do
768- k { ref := ref , fvarDecls := localDecls.toList, patterns := patterns.toList } matchType
768+ k { ref := lhsStx , fvarDecls := localDecls.toList, patterns := patterns.toList } matchType
769769
770770/--
771771 Try to clear the free variables in `toClear` and auxiliary discriminants, and then execute `k` in the updated local context.
@@ -817,7 +817,7 @@ private def elabMatchAltView (discrs : Array Discr) (alt : MatchAltView) (matchT
817817 let (patternVars, alt) ← collectPatternVars alt
818818 trace[Elab.match] "patternVars: {patternVars}"
819819 withPatternVars patternVars fun patternVarDecls => do
820- withElaboratedLHS alt.ref patternVarDecls alt.patterns alt.lhs discrs.size matchType fun altLHS matchType =>
820+ withElaboratedLHS patternVarDecls alt.patterns alt.lhs discrs.size matchType fun altLHS matchType =>
821821 withEqs discrs altLHS.patterns fun eqs =>
822822 withLocalInstances altLHS.fvarDecls do
823823 trace[Elab.match] "elabMatchAltView: {matchType}"
0 commit comments