@@ -788,11 +788,11 @@ process fn (Undefine names) = undefine names
788 do replDefs <- idris_repl_defs `fmap` get
788 do replDefs <- idris_repl_defs `fmap` get
789 callGraph <- whoCalls n
789 callGraph <- whoCalls n
790 let users = case lookup n callGraph of
790 let users = case lookup n callGraph of
791− Just ns -> ns
791+ Just ns -> nub ns
792 Nothing -> fail ("Tried to undefine nonexistent name" ++ show n)
792 Nothing -> fail ("Tried to undefine nonexistent name" ++ show n)
793 undefinedJustNow <- concat `fmap` mapM undefClosure users
793 undefinedJustNow <- concat `fmap` mapM undefClosure users
794 undefOne n
794 undefOne n
795− return (n : undefinedJustNow)
795+ return (nub (n : undefinedJustNow))