From 95910108dc12e262b4d49bd7b08796b9bfaff6e0 Mon Sep 17 00:00:00 2001 From: Sebastian Ullrich Date: Tue, 3 Nov 2020 11:13:20 +0100 Subject: [PATCH] fix: delaborator: share mdata tree position with child --- src/Lean/Delaborator.lean | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Lean/Delaborator.lean b/src/Lean/Delaborator.lean index fe5222772d..b234d66f6b 100644 --- a/src/Lean/Delaborator.lean +++ b/src/Lean/Delaborator.lean @@ -214,7 +214,8 @@ def withProj {α} (d : DelabM α) : DelabM α := do def withMDataExpr {α} (d : DelabM α) : DelabM α := do let Expr.mdata _ e _ ← getExpr | unreachable! - descend e 0 d + -- do not change position so that options on an mdata are automatically forwarded to the child + withReader ({ · with expr := e }) d partial def annotatePos (pos : Nat) : Syntax → Syntax | stx@(Syntax.ident _ _ _ _) => stx.setInfo { pos := pos }