Closed klkblake closed 10 years ago
Do you have a self contained program which demonstrates this issue? I've just constructed one and it typechecks fine. It is possible that I've just fixed it while fixing another problem, though.
The "Can't unify x with x" thing is irritating, and I'm not sure how we might fix it yet. It arises because of shadowing - probably some kind of hint as to which bits are different would be useful.
If you load it in Emacs, mousing over the variables will show internal IDs. This can distinguish them.
Perhaps we can print binding site information in errors when there's shadowing?
Unfortunately, I do not have a test program -- I changed the way PType works, and I didn't think to keep a copy. I do remember that removing the "a" type variable was enough to make it type-check. However, I've found that Idris seems to do more theorem-proving about the program than I thought, and the fact that Set only had temporary constructors that did not reflect the actual invariants may or may not have influenced it (I had another type error where that was the problem).
I'm closing this because I can't do anything without more information, and as reported it works fine! If it happens again and you still have the test case, please reopen the issue.
When typechecking this instance declaration (Note that this is the only use of the name v1 in the program):
I get the following error message:
I don't know if the error itself is a bug, but if it's not, the uninformitive error message probably should be. Possibly relevant context for the above:
I am using the latest git version (0.9.11.2-git:ecfb293), so I have the recent unification changes.