File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed
Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ private def throwForInFailure (forInInstance : Expr) : TermElabM Expr :=
5555 match stx with
5656 | `(for_in'% $col $init $body) =>
5757 tryPostponeIfNoneOrMVar expectedType?
58- let colE ← elabTerm col none
58+ let colE ← withSynthesizeLight ( elabTerm col none)
5959 let m ← getMonadForIn expectedType?
6060 let colType ← inferType colE
6161 let elemType ← mkFreshExprMVar (mkSort (mkLevelSucc (← mkFreshLevelMVar)))
@@ -65,6 +65,7 @@ private def throwForInFailure (forInInstance : Expr) : TermElabM Expr :=
6565 mkAppM ``ForIn' #[m, colType, elemType, memType]
6666 catch _ =>
6767 tryPostpone; throwError "failed to construct `ForIn'` instance for collection{indentExpr colType}\n and monad{indentExpr m}"
68+ synthesizeSyntheticMVarsUsingDefault
6869 match (← trySynthInstance forInInstance) with
6970 | .some inst =>
7071 let forInFn ← mkConst ``forIn'
Original file line number Diff line number Diff line change @@ -57,6 +57,10 @@ def h (n : Nat) : IO Unit := do
5757 for i in *...n, j in 2 ...* do
5858 IO.println s! "i={ i} , j={ j} "
5959
60+ example : Unit := Id.run do
61+ for _h : _i in 4 ...<12 do
62+ pure .unit
63+
6064/--
6165info: i=0, j=2
6266i=1, j=3
You can’t perform that action at this time.
0 commit comments