@@ -566,6 +566,8 @@ solve ctxt env (Bind x (Guess ty val) sc)
566 = do ps <- get
566 = do ps <- get
567 dropdots <-
567 dropdots <-
568 case lookup x (notunified ps) of
568 case lookup x (notunified ps) of
570+ | h == x -> return [] -- Can't solve itself!
569 Just tm -> -- trace ("NEED MATCH: " ++ show (x, tm, val) ++ "\nIN " ++ show (pterm ps)) $
571 Just tm -> -- trace ("NEED MATCH: " ++ show (x, tm, val) ++ "\nIN " ++ show (pterm ps)) $
570 do match_unify' ctxt env (tm, Just InferredVal)
572 do match_unify' ctxt env (tm, Just InferredVal)
571 (val, Just GivenVal)
573 (val, Just GivenVal)