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

Improve the error message when redefining a builtin function #485

Closed
developedby opened this issue May 24, 2024 · 0 comments · Fixed by #567
Closed

Improve the error message when redefining a builtin function #485

developedby opened this issue May 24, 2024 · 0 comments · Fixed by #567
Labels
compilation Compilation of terms and functions to HVM enhancement New feature or request

Comments

@developedby
Copy link
Member

Is your feature request related to a problem? Please describe.
When redefining a builtin function, the error message just shows Redefinition of function 'XXX'. This is a bit confusing if the user doesn't know that XXX is a builtin, since it seems to be coming out of nowhere and doesn't point to the first definition.

Describe the solution you'd like
It would be better if the message showed Redefinition of builtin (function) 'XXX'.

Describe alternatives you've considered
Storing the span of functions and printing the context of the first definition. This would greatly increase the complexity of the parser and slightly increase the complexity of the AST, so I"d rather not do it unless we really need to.

@developedby developedby added enhancement New feature or request compilation Compilation of terms and functions to HVM labels May 24, 2024
github-merge-queue bot pushed a commit that referenced this issue Jun 7, 2024
…age-when-redefining-a-builtin-function

#485 Improve the error message when redefining a builtin function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compilation Compilation of terms and functions to HVM enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant