@@ -1027,7 +1027,12 @@ elabClause info opts (_, PWith fc fname lhs_in withs wval_in pn_in withblock)
10271027
10281028 logElab 5 ("Checked " ++ show clhs)
10291029 let bargs = getPBtys (explicitNames (normalise ctxt [] lhs_tm))
1030− let wval = rhs_trans info $ addImplBound i (map fst bargs) wval_in
1030+ wval <- case wval_in of
1031+ Placeholder -> ierror $ At fc $
1032+ Msg "No expression for the with block to inspect.\nYou need to replace the _ with an expression."
1033+ _ -> return $
1034+ rhs_trans info $
1035+ addImplBound i (map fst bargs) wval_in
10311036 logElab 5 ("Checking " ++ showTmImpls wval)
10321037 -- Elaborate wval in this context
10331038 ((wvalElab, defer, is, ctxt', newDecls, highlights, newGName), _) <-