@@ -1744,6 +1744,17 @@ mkUniqueNames env tm = evalState (mkUniq tm) env where
17441744 mkUniq (PPair fc p l r)
17451745 = do l' <- mkUniq l; r' <- mkUniq r
17461746 return $! PPair fc p l' r'
1747+ mkUniq (PDPair fc (PRef fc' n) t sc)
1748+ | t /= Placeholder
1749+ = do env <- get
1750+ (n', sc') <- if n `elem` env
1751+ then do let n' = uniqueName n (env ++ inScope)
1752+ return (n', shadow n n' sc)
1753+ else return (n, sc)
1754+ put (n' : env)
1755+ t' <- mkUniq t
1756+ sc'' <- mkUniq sc'
1757+ return $! PDPair fc (PRef fc' n') t' sc''
17471758 mkUniq (PDPair fc l t r)
17481759 = do l' <- mkUniq l; t' <- mkUniq t; r' <- mkUniq r
17491760 return $! PDPair fc l' t' r'