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

Parse errors on deriving clauses a class itself causes a crash #351

Closed
anka-213 opened this issue Aug 24, 2024 · 0 comments · Fixed by #365
Closed

Parse errors on deriving clauses a class itself causes a crash #351

anka-213 opened this issue Aug 24, 2024 · 0 comments · Fixed by #365
Assignees
Labels
bug Something isn't working
Milestone

Comments

@anka-213
Copy link
Member

I was trying to add deriving to all my data types with a naive regex which caused the following code:

record Example : Set where
{-# COMPILE AGDA2HS Example deriving (Show, Eq, Ord) class #-}

Trying to run agda2hs on it gives the following error:

$ agda2hs Bug.agda
Checking Bug (Bug.agda).
An internal error has occurred. Please report this as a bug.
Location of the error: __IMPOSSIBLE__, called at src/full/Agda/Utils/FileName.hs:56:20 in Agda-2.6.4.1-7xG50m7UQLK4krJEY6TPg:Agda.Utils.FileName

Not that anyone should do this, but the error message said it's a bug, so I might as well report it so mistakes like these can get better error messages.

@jespercockx jespercockx added the bug Something isn't working label Sep 17, 2024
@anka-213 anka-213 changed the title Mistakenly trying to derive instances on a class itself causes a crash Parse errors on deriving clauses a class itself causes a crash Sep 22, 2024
@anka-213 anka-213 self-assigned this Sep 22, 2024
anka-213 added a commit to anka-213/agda2hs that referenced this issue Sep 22, 2024
@jespercockx jespercockx added this to the 1.3 milestone Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants