-
Notifications
You must be signed in to change notification settings - Fork 365
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
Misleading error messages in mutual definitions. #3499
Comments
For the flipped version, maybe Agda tries to parse definitions like f a : Bla
g f = bla as a "copattern matching", which is kind of problematic. Adding |
Renaming the variables can be a workaround. |
The problem is that the assignment of clauses to functions happens even before scope checking in https://github.com/agda/agda/blob/master/src/full/Agda/Syntax/Concrete/Definitions.hs and the heuristics to assign a function clause to a name is necessarily very crude: agda/src/full/Agda/Syntax/Concrete/Definitions.hs Lines 1279 to 1305 in 38cbf84
@UlfNorell made some initial efforts to get rid of this pre-pass, then (doing it in the scope checker) the heuristics could be way better. |
The message is the following:
If the definition of
f
is moved beforeg
is declared or theg
argument tof
is renamed than everything of course is fine.If the definition of
f
is moved after the definition ofg
then the error message is different:Is this behaviour expected?
The text was updated successfully, but these errors were encountered: