Skip to content

Commit b146691

Browse files
committed
approach 1 *seems* to work
1 parent 145fc0d commit b146691

File tree

3 files changed

+1
-16
lines changed

3 files changed

+1
-16
lines changed

src/Lean/Elab/SyntheticMVars.lean

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,14 @@ private def resumePostponed (savedContext : SavedContext) (stx : Syntax) (mvarId
3737
let mvarDecl ← getMVarDecl mvarId
3838
let expectedType ← instantiateMVars mvarDecl.type
3939
let ret ← withInfoHole mvarId do
40-
logInfo m!"resumeElabTerm..."
4140
let result ← resumeElabTerm stx expectedType (!postponeOnError)
4241
/- We must ensure `result` has the expected type because it is the one expected by the method that postponed stx.
4342
That is, the method does not have an opportunity to check whether `result` has the expected type or not. -/
44-
logInfo m!"ensureHasType..."
4543
let result ← do
4644
if (← getInfoState).enabled then
4745
let savedInfoTrees ← getResetInfoTrees
4846
-- withRef stx <| ensureHasType expectedType result
49-
Prod.fst <$> MonadFinally.tryFinally' (withRef stx <| ensureHasType expectedType result) fun a? => do
47+
Prod.fst <$> MonadFinally.tryFinally' (withRef stx <| ensureHasType expectedType result) fun _ => do
5048
modifyInfoState fun state =>
5149
if savedInfoTrees.size > 0 then
5250
let mod (t : InfoTree) : InfoTree :=
@@ -58,9 +56,6 @@ private def resumePostponed (savedContext : SavedContext) (stx : Syntax) (mvarId
5856
{ state with trees := savedInfoTrees }
5957
else
6058
withRef stx <| ensureHasType expectedType result
61-
let trees ← getInfoTrees
62-
let strs ← trees.toArray.mapM (·.format')
63-
logInfo m!"withInfoHole inner {strs}"
6459
/- We must perform `occursCheck` here since `result` may contain `mvarId` when it has synthetic `sorry`s. -/
6560
if (← occursCheck mvarId result) then
6661
mvarId.assign result

src/Lean/Elab/Term/TermElabM.lean

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1208,17 +1208,10 @@ def mkCoe (expectedType : Expr) (e : Expr) (f? : Option Expr := none) (errorMsgH
12081208
withoutMacroStackAtErr do
12091209
match ← coerce? e expectedType with
12101210
| .some eNew =>
1211-
let trees ← getInfoTrees
1212-
let strs ← trees.toArray.mapM (fun t => do return (← t.format'))
1213-
logInfo m!"{strs}"
12141211
pushInfoLeaf (.ofCustomInfo {
12151212
stx := ← getRef
12161213
value := Dynamic.mk <| CoeExpansionTrace.mk []
12171214
})
1218-
logInfo m!"pushed info leaf"
1219-
let trees ← getInfoTrees
1220-
let strs ← trees.toArray.mapM (fun t => do return (← t.format'))
1221-
logInfo m!"{strs}"
12221215
return eNew
12231216
| .none => failure
12241217
| .undef =>
@@ -1529,7 +1522,6 @@ private def elabUsingElabFnsAux (s : SavedState) (stx : Syntax) (expectedType? :
15291522
| (elabFn::elabFns) =>
15301523
try
15311524
-- record elaborator in info tree, but only when not backtracking to other elaborators (outer `try`)
1532-
logInfo m!"enter term info context for {stx}"
15331525
let ret ← withTermInfoContext' elabFn.declName stx (expectedType? := expectedType?)
15341526
(try
15351527
elabFn.value stx expectedType?
@@ -1563,7 +1555,6 @@ private def elabUsingElabFnsAux (s : SavedState) (stx : Syntax) (expectedType? :
15631555
postponeElabTermCore stx expectedType?
15641556
else
15651557
throw ex)
1566-
logInfo m!"leave term info context for {stx}"
15671558
pure ret
15681559
catch ex => match ex with
15691560
| .internal id _ =>

tests/lean/run/test.lean

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
structure X
22
def X.x (_ : X) : BaseIO Bool := sorry
33

4-
set_option trace.Elab.info true
54
def f : IO Unit := do
65
let _ ← ([] : List X).findM? fun p => p.x

0 commit comments

Comments
 (0)