Circular functional dependencies cause loop in typechecker
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.
Trac metadata
Trac field | Value |
---|---|
Version | 7.0.3 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler (Type checker) |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | simonpj@microsoft.com, stevez@cis.upenn.edu |
Operating system | |
Architecture |