Skip to content
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

Mixing notations and tactics makes Coq report errors in the wrong file #14933

Open
Mbodin opened this issue Sep 24, 2021 · 0 comments
Open

Mixing notations and tactics makes Coq report errors in the wrong file #14933

Mbodin opened this issue Sep 24, 2021 · 0 comments
Labels
kind: bug An error, flaw, fault or unintended behaviour. kind: user messages Improvement of error messages, new warnings, etc. part: notations The notation system.

Comments

@Mbodin
Copy link
Contributor

Mbodin commented Sep 24, 2021

Description of the problem

It took me a while to understand what was happening.
Here is a self-contained example:

Notation "'test' x" :=
  (ltac:(exact x))
  (at level 50, no associativity, only parsing).

Definition t :=
  test something_undefined.

This code is rejected by Coq (and meant to be: something_undefined is not defined).
My issue is about the error message, and in particular the place where the error is displayed: Coq complains with Error: The reference x was not found in the current environment., pointing to the definition of the notation ((ltac:(exact x))), instead of its usage (test something_undefined).

Coq even does this if the notation is defined in a separate file, which makes the error very difficult to understand and/or work with.
In my usage case, the notation was defined in a first file that compiled fine, but was erroneously used in a second file… but the error reported on the first file (that actually compiled fine). This made me check the first file instead of the erroneously usage (of which I couldn’t easily know the line).

Coq Version

$ coqtop -v
The Coq Proof Assistant, version 8.13.0 (September 2021)
compiled on Sep 8 2021 9:03:15 with OCaml 4.13.0~beta1
@Alizter Alizter added kind: bug An error, flaw, fault or unintended behaviour. kind: user messages Improvement of error messages, new warnings, etc. part: notations The notation system. labels Sep 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: bug An error, flaw, fault or unintended behaviour. kind: user messages Improvement of error messages, new warnings, etc. part: notations The notation system.
Projects
None yet
Development

No branches or pull requests

2 participants