@@ -232,10 +232,9 @@ buildDepMap ci ctx mainName = addPostulates $ dfs S.empty M.empty [mainName]
232232 getDeps :: Name -> Deps
233233 getDeps (SN (WhereN i (SN (InstanceCtorN classN)) (MN i' field)))
234234 = M.empty -- these deps are created when applying instance ctors
235− getDeps n = case lookupDef n ctx of
236− [def] -> getDepsDef n def
237− [] -> error $ "erasure checker: unknown reference: " ++ show n
238− _ -> error $ "erasure checker: ambiguous reference: " ++ show n
235+ getDeps n = case lookupDefExact n ctx of
236+ Just def -> getDepsDef n def
237+ Nothing -> error $ "erasure checker: unknown reference: " ++ show n
239238
240239 getDepsDef :: Name -> Def -> Deps
241240 getDepsDef fn (Function ty t) = error "a function encountered" -- TODO