@@ -1741,7 +1741,7 @@ elabClause info opts (_, PWith fc fname lhs_in withs wval_in withblock)
1741 logLvl 3 (show lhs_tm)
1741 logLvl 3 (show lhs_tm)
1742 (clhs, clhsty) <- recheckC fc [] lhs_tm
1742 (clhs, clhsty) <- recheckC fc [] lhs_tm
1743 logLvl 5 ("Checked " ++ show clhs)
1743 logLvl 5 ("Checked " ++ show clhs)
1744− let bargs = getPBtys lhs_tm
1744+ let bargs = getPBtys (explicitNames (normalise ctxt [] lhs_tm))
1745 let wval = addImplBound i (map fst bargs) wval_in
1745 let wval = addImplBound i (map fst bargs) wval_in
1746 logLvl 5 ("Checking " ++ showTmImpls wval)
1746 logLvl 5 ("Checking " ++ showTmImpls wval)
1747 -- Elaborate wval in this context
1747 -- Elaborate wval in this context
@@ -1763,7 +1763,7 @@ elabClause info opts (_, PWith fc fname lhs_in withs wval_in withblock)
1763 logLvl 5 ("Checked wval " ++ show wval')
1763 logLvl 5 ("Checked wval " ++ show wval')
1764 (cwval, cwvalty) <- recheckC fc [] (getInferTerm wval')
1764 (cwval, cwvalty) <- recheckC fc [] (getInferTerm wval')
1765 let cwvaltyN = explicitNames (normalise ctxt [] cwvalty)
1765 let cwvaltyN = explicitNames (normalise ctxt [] cwvalty)
1766− let cwvalN = explicitNames cwval
1766+ let cwvalN = explicitNames (normalise ctxt [] cwval)
1767 logLvl 5 ("With type " ++ show cwvalty ++ "\nRet type " ++ show ret_ty)
1767 logLvl 5 ("With type " ++ show cwvalty ++ "\nRet type " ++ show ret_ty)
1768 let pvars = map fst (getPBtys cwvalty)
1768 let pvars = map fst (getPBtys cwvalty)
1769 -- we need the unelaborated term to get the names it depends on
1769 -- we need the unelaborated term to get the names it depends on