Skip to content

Commit ac853c6

Browse files
committed
chore: DeriveTraversable: pattern match by name (leanprover-community#31232)
Pattern match on `InductionSubgoal` by name, more robust against changes to the number of other fields.
1 parent fa7b276 commit ac853c6

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Mathlib/Tactic/DeriveTraversable.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,15 +287,15 @@ def deriveLawfulFunctor (m : MVarId) : TermElabM Unit := do
287287
let (#[_, x], mim) ← mim.introN 2 | failure
288288
let (some mim, _) ← dsimpGoal mim (← rules [] [``Functor.map] false) | failure
289289
let xs ← mim.induction x (mkRecName n)
290-
xs.forM fun mim, _, _⟩ =>
290+
xs.forM fun { mvarId := mim, .. } =>
291291
mim.withContext do
292292
if let (some (_, mim), _) ←
293293
simpGoal mim (← rules [(``Functor.map_id, false)] [.mkStr n "map"] true) then
294294
mim.refl
295295
let (#[_, _, _, _, _, x], mcm) ← mcm.introN 6 | failure
296296
let (some mcm, _) ← dsimpGoal mcm (← rules [] [``Functor.map] false) | failure
297297
let xs ← mcm.induction x (mkRecName n)
298-
xs.forM fun mcm, _, _⟩ =>
298+
xs.forM fun { mvarId := mcm, .. } =>
299299
mcm.withContext do
300300
if let (some (_, mcm), _) ←
301301
simpGoal mcm (← rules [(``Functor.map_comp_map, true)] [.mkStr n "map"] true) then

0 commit comments

Comments
 (0)