-
Notifications
You must be signed in to change notification settings - Fork 182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Return early when treating ambiguous cycles #48
Conversation
_ => () | ||
}; | ||
|
||
answer = actual_answer; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it possible to make a test for this? or is that test basically just in your PR for #12?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well that's funny because in fact if I provide a test for that and deactivate the fix, the test program will not even load because of the overlap check which will loop forever. So I was indeed relying on this behaviour to test the fix in my PR for #12 (the trait_wf
test would not load without the fix). Still I added a general test in this PR, which is better for documentation.
src/solve/solver.rs
Outdated
} else { | ||
answer = actual_answer; | ||
} | ||
let fixed_point = actual_answer == answer; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a comment here explaining why we have this special case? Also, I suspect that you can get into similar problems when you have guidance as well, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suspect it as well although ambig with guidance can perform some unification, but I cannot find examples where a cycle gives ambig with guidance after being fed. Nonetheless stopping when we get Ambig
regardless of the guidance should not affect correctness of the final answer.
This should solve the problem where an
Ambig(Unknown)
answer was used to feed a cycle and not producing back any answer.