@@ -244,6 +244,9 @@ buildDepMap ci ctx ns = addPostulates $ dfs S.empty M.empty ns
244244 | otherwise
245245 -> node n args -- depends on whether the referred thing uses its argument
246246
247+ -- TODO: could we somehow infer how bound variables use their arguments?
248+ V i -> M.unionWith S.union ((bs !! i) cd) (unconditionalDeps args)
249+
247250 -- we interpret applied lambdas as lets in order to reuse code here
248251 Bind n (Lam ty) t -> getDepsTerm vs bs cd (lamToLet [] app)
249252
@@ -261,6 +264,8 @@ buildDepMap ci ctx ns = addPostulates $ dfs S.empty M.empty ns
261264 Proj t i
262265 -> error $ "cannot analyse projection !" ++ show i ++ " of " ++ show t
263266
267+ Erased -> M.empty
268+
264269 _ -> error $ "cannot analyse application of " ++ show fun ++ " to " ++ show args
265270 where
266271 ins = M.insertWith S.union cd