Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Kha committed Jul 24, 2024
1 parent 4eb53cc commit 5d1dfc3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Lean/Elab/MutualDef.lean
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,7 @@ private def elabFunValues (headers : Array DefViewElabHeader) (vars : Array Expr
-- NOTE: without this `instantiatedMVars`, `mkLambdaFVars` may leave around a redex that
-- leads to more section variables being included than necessary
let val ← instantiateMVars val
let val ← mkLambdaFVars xs val
unless header.type.hasSorry || val.hasSorry do
for var in vars do
unless header.type.containsFVar var.fvarId! || val.containsFVar var.fvarId! || (← vars.anyM (fun v => return (← v.fvarId!.getType).containsFVar var.fvarId!)) do
Expand All @@ -387,7 +388,7 @@ private def elabFunValues (headers : Array DefViewElabHeader) (vars : Array Expr
else
var
logWarningAt header.ref m!"included section variable '{var}' is not used in '{header.declName}', consider excluding it"
mkLambdaFVars xs val
return val
if let some snap := header.bodySnap? then
snap.new.resolve <| some {
diagnostics :=
Expand Down

0 comments on commit 5d1dfc3

Please sign in to comment.