-
Notifications
You must be signed in to change notification settings - Fork 345
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
RFC: GuessLex omit source pos from error message #4519
Comments
I am unsure. If a user is faced with this error message they might really need this help to identify the respective calls, and so far I did not think of a better way. Do you? I assume it bother you in the context of tests? Happy to accept a PR that adds an option to omit them, similar to |
Yes. When writing code to test output messages, the test code must be modified frequently each time the file is changed. |
Got it. What is your use case for testing failing function definitions? The lean test suite itself, or some other project? You could also test it indirectly: use guard_msgs to hide the error text, and then afterwards check that the function is not fully constructed (e.g. no |
I'm writing Lean reference book (https://lean-ja.github.io/lean-by-example/, Japanese) and I use |
oh nice! it is interesting #guard_msgs (drop all) in
def alternate {α : Type} (xs ys : List α) : List α :=
match xs, ys with
| [], ys => ys
| x :: xs, ys => x :: alternate ys xs
/-
alternate [1, 2] [3, 4]
-/
#reduce alternate [1, 2] [3, 4] |
That's great work, thanks! But hopefully you understand that this is a special case and shouldn't guide the error message phrasing. Are you unblocked by the |
No. I would be happy to be able to display the error message itself, so I would still be happy if there was a way to remove the specific line number from the error message. |
Ok this is reasonable. You can close this as not planned. |
This is plausible - in Verso, it would be fairly easy to write a program that checked Lean messages for equality modulo substrings that look like source positions and/or metavariable names, so the error in the book matches what users will see but it doesn't need updating quite so often. |
Proposal
The following output message contains a line number in editor
26:24-39 ? ?
. But this is quite fragile to change, so I want to remove the line numbering part.Community Feedback
see https://leanprover.zulipchat.com/#narrow/stream/217875-Is-there-code-for-X.3F/topic/omit.20line.20number.20from.20message/near/445973308
Impact
Add 👍 to issues you consider important. If others benefit from the changes in this proposal being added, please ask them to add 👍 to it.
The text was updated successfully, but these errors were encountered: