@@ -1741,7 +1741,7 @@ elabClause info opts (_, PWith fc fname lhs_in withs wval_in withblock)
17411741 logLvl 3 (show lhs_tm)
17421742 (clhs, clhsty) <- recheckC fc [] lhs_tm
17431743 logLvl 5 ("Checked " ++ show clhs)
1744− let bargs = getPBtys lhs_tm
1744+ let bargs = getPBtys (explicitNames (normalise ctxt [] lhs_tm))
17451745 let wval = addImplBound i (map fst bargs) wval_in
17461746 logLvl 5 ("Checking " ++ showTmImpls wval)
17471747 -- Elaborate wval in this context
@@ -1763,7 +1763,7 @@ elabClause info opts (_, PWith fc fname lhs_in withs wval_in withblock)
17631763 logLvl 5 ("Checked wval " ++ show wval')
17641764 (cwval, cwvalty) <- recheckC fc [] (getInferTerm wval')
17651765 let cwvaltyN = explicitNames (normalise ctxt [] cwvalty)
1766− let cwvalN = explicitNames cwval
1766+ let cwvalN = explicitNames (normalise ctxt [] cwval)
17671767 logLvl 5 ("With type " ++ show cwvalty ++ "\nRet type " ++ show ret_ty)
17681768 let pvars = map fst (getPBtys cwvalty)
17691769 -- we need the unelaborated term to get the names it depends on