on master help sign in
Fix non-termination error in universe checker
commite2809b62aa3127954837afa5c5152937c4a669a7 authorEdwin Brady <ecb10@st-andrews.ac.uk> dateMon 18 Feb 2013, 17:59 (14 years ago) parent06bfa75
1 file changed+4
src/Core/Constraints.hs+4
src/Core/Constraints.hs+4
@@ -52,6 +52,10 @@ acyclic r cvs = checkCycle (FC "root" 0) r [] 0 cvs
5252 = Error $ At fc UniverseError
5353 -- FIXME: Make informative
5454 -- e.g. (Msg ("Cycle: " ++ show cv ++ ", " ++ show path))
55+ -- if we reach a cycle but we're at the same universe level, it's
56+ -- fine, because they must all be equal, so stop.
57+ | inc == 0 && cv `elem` map fst path
58+ = return ()
5559 | otherwise = case M.lookup cv r of
5660 Nothing -> return ()
5761 Just cs -> mapM_ (next ((cv, fc):path) inc) cs