#5236: Circular functional dependencies cause loop in typechecker
---------------------------------+------------------------------------------
    Reporter:  dimitris          |       Owner:                         
        Type:  bug               |      Status:  new                    
    Priority:  normal            |   Component:  Compiler (Type checker)
     Version:  7.0.3             |    Keywords:                         
    Testcase:                    |   Blockedby:                         
          Os:  Unknown/Multiple  |    Blocking:                         
Architecture:  Unknown/Multiple  |     Failure:  None/Unknown           
---------------------------------+------------------------------------------
 In the attached file, a dictionary (Id A B) is rewritten with two
 functional dependencies (A -> B, B -> A) and two errors are added in our
 constraint bag (rightfully so), but the new workitem is symmetric (Id B
 A), goes back in the worklist and in the new iteration of the solver we
 have exactly the same process repeated.

 This is a solveInteractWithDepth loop, not a solve_wanteds loop.
 I think the right thing to do is in doTopReact: (1) first try to apply
 functional dependencies, (2) then check if an instance matches, and (3) do
 a ContinueWith or a Stop but never throw the workitem back in the worklist
 as happens now. I have to discuss
 this with Simon.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5236>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to