1lab/mikan
13
52
Fork
You've already forked mikan
9

Diagnostic messages should not print back "input" abstract syntax #98

Open
opened 2026年05月15日 15:45:40 +02:00 by amyliao · 2 comments

This happens primarily when printing the Call, i.e. "when [...]" part of the error message. If the user wrote it, we should be able to point to it in her file. We do not have an exact printer, and abstract syntax is already desugared ("nicified") compared to what the user wrote. Consequently, the errors are both inaccurate and overly verbose. Compare the declaration:

xwheredataD(A:Set):Setwherec:DA

with the error message:

/home/amelia/default/Projects/agda/test/Fail/AbsToConDecl.agda:3.1-5.14:error:[AbsentRHSRequiresAbsurdPattern]Theright-handsidecanonlybeomittedifthereisanabsurdpattern,()or{},intheleft-handside.whencheckingthattheclausexwheremutualdataD(A:Set):Setwherec:DAhastype_1
This happens primarily when printing the `Call`, i.e. "when [...]" part of the error message. If the user wrote it, we should be able to point to it in her file. We do not have an exact printer, and abstract syntax is *already* desugared ("nicified") compared to what the user wrote. Consequently, the errors are both inaccurate *and* overly verbose. Compare the declaration: ```agda x where data D (A : Set) : Set where c : D A ``` with the error message: ```agda /home/amelia/default/Projects/agda/test/Fail/AbsToConDecl.agda:3.1-5.14: error: [AbsentRHSRequiresAbsurdPattern] The right-hand side can only be omitted if there is an absurd pattern, () or {}, in the left-hand side. when checking that the clause x where mutual data D (A : Set) : Set where c : D A has type _1 ```
Author
Owner
Copy link

One alternative is to replace the definite "the clause [blah]" with a demonstrative "this clause", and (in editor) highlight the location or (in batch mode) print back the source text with ANSI underlines or something to point out the location.

One alternative is to replace the definite "the clause [blah]" with a demonstrative "this clause", and (in editor) highlight the location or (in batch mode) print back the source text with ANSI underlines or something to point out the location.
Author
Owner
Copy link
test x := x + x + x + x + x + x + x + x + x + x + x + x + x + x + x
+
x
+

oh my god

https://codeberg.org/1lab/mikan/src/commit/f56118785f5e78eca5592a7601a6f547353b8a06/test/Fail/Issue7722.err#L5-L8 oh my god
Sign in to join this conversation.
No Branch/Tag specified
main
aliao/occurs-opt
aliao/rec-con
fix-license
aliao/oopsie
aliao/strengthen-iapply
No results found.
Labels
Clear labels
1 - scope
language
Backwards-compatible changes to the surface language, such as adding new features.
1 - scope
language change
Breaking changes to a documented part of the surface language. These should be documented and specifically called out in the changelog.
1 - scope
performance
Semantics-preserving performance work.
1 - scope
task
Changes that are not apparent to the user, e.g. developer documentation and refactors, which do not need to be documented.
A: dead-code
Dead code elimination and --save-metas.
A: errors
Reporting of error and warning messages.
A: highlighting
Highlighting during interaction & literate compilation
A: imports
Handling of imports and interface file de/serialization.
A: infra
Iinfrastructure (e.g. CI, developer documentation, the build system, or the repository itself)
A: instance
Instance declarations, arguments, and resolution
A: lhs
LHS checking, coverage checking, and clause compilation
A: modules
Declaration and instantiation of parametrised modules.
A: parallel
Parallel typechecking.
A: positivity
Positivity checking
A: printing
Pretty-printing, display forms, and the wording of diagnostic messages
A: records
Record declarations, record expressions and copattern matching
A: scoping
Scope checking (ConcreteToAbstract)
A: termination
Termination checking
0 - type
bug
Issues describing an incorrect behaviour in the project, typos in the documentation, etc.
0 - type
discussion
An issue raised to gather opinions on a proposed change, or a suggested language change.
0 - type
question
An issue raised to ask a question.
9 - status
duplicate
This issue or pull request already exists.
9 - status
info needed
More information is needed from the submitter to decide how to proceed with the issue report.
9 - status
invalid
The issue report or pull request does not describe an actual bug, or does otherwise does not meet the contributing guidelines.
good first issue
Interested in contributing? Get started here.
upstream
Related to an upstream repository, already reported there
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
1lab/mikan#98
Reference in a new issue
1lab/mikan
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?