X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Ftypecheck%2FTcInteract.lhs;h=cb9d34266122da97e48b400278a743f40887009e;hb=25bff7fe1a22edbafa188af8d844c67057fa5eb8;hp=5285435b5eaa7f36d466c959d504d7636b688826;hpb=f8b7b3c6100d55125543b5f833b1a0078ad68908;p=ghc-hetmet.git diff --git a/compiler/typecheck/TcInteract.lhs b/compiler/typecheck/TcInteract.lhs index 5285435..cb9d342 100644 --- a/compiler/typecheck/TcInteract.lhs +++ b/compiler/typecheck/TcInteract.lhs @@ -531,16 +531,20 @@ spontaneousSolveStage workItem inerts , sr_stop = ContinueWith workItem } Just (workItem', workList') - | not (isGivenCt workItem) -- Original was wanted or derived but we have now made him - -- given so we have to interact him with the inerts due to - -- its status change. This in turn may produce more work. - -> do { (new_inert, new_work) <- runSolverPipeline [ ("recursive interact with inert eqs", interactWithInertEqsStage) - , ("recursive interact with inerts", interactWithInertsStage) - ] inerts workItem' - ; return $ SR { sr_new_work = new_work `unionWorkLists` workList' + | not (isGivenCt workItem) + -- Original was wanted or derived but we have now made him + -- given so we have to interact him with the inerts due to + -- its status change. This in turn may produce more work. + -- We do this *right now* (rather than just putting workItem' + -- back into the work-list) because we've solved + -> do { (new_inert, new_work) <- runSolverPipeline + [ ("recursive interact with inert eqs", interactWithInertEqsStage) + , ("recursive interact with inerts", interactWithInertsStage) + ] inerts workItem' + ; return $ SR { sr_new_work = new_work `unionWorkLists` workList' , sr_inerts = new_inert -- will include workItem' , sr_stop = Stop } - } + } | otherwise -> -- Original was given; he must then be inert all right, and -- workList' are all givens from flattening