-
Notifications
You must be signed in to change notification settings - Fork 57
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
Declaring TC instance in section can throw anomaly on closing #618
Comments
It seems the bug is in Coq, file let add_instance_base inst =
let locality = match inst.locality with
| Local -> Local
| SuperGlobal ->
(* i.e. in a section, declare the hint as local since discharge is managed
by rebuild_instance which calls again add_instance_hint; don't ask hints
to take discharge into account itself *)
if Lib.sections_are_opened () then Local
else SuperGlobal
| Export ->
(* Same as above for export *)
if Lib.sections_are_opened () then Local
else Export
in
add_instance_hint inst.instance ~locality
inst.info CC @Janno @rlepigre that may be impacted too. I did not test a fix, so I'm only speculating, but it seems plausible. Thanks for reporting the bug. |
Because I'm super busy. @trilis if you have the time to patch Coq and confirm my analysis, it would be great. Otherwise you'll have to wait (about a month I'm afraid). |
Sure, I'll try to patch. Thanks for pointing me to the relevant code. |
I can confirm that the anomaly in the minimized example is gone with the proposed fix. However, when trying to apply this fix to our real code, I found another anomaly: (removed from this issue, see #619) |
Could you please open another bugreport, this is about locate and not TC. The bug could be as well in Coq. |
Sure, I created separate bugreport and submitted PR to coq repo |
Here is the minimal example:
On the ending of the section, I get this anomaly:
It seems like some hints are replayed when they shouldn't.
Note that everything works fine when we do
declare-instance
andend-section
in separate commands, or when we do everything (begin-section
,declare-instance
andend-section
) in one command, or when we remove@global!
.Coq 8.19.1, coq-elpi 2.1.0. We definitely didn't have this issue before synterp introduction.
The text was updated successfully, but these errors were encountered: