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

Internal Happy errors are not helpful #241

Closed
Kleidukos opened this issue Sep 17, 2022 · 2 comments
Closed

Internal Happy errors are not helpful #241

Kleidukos opened this issue Sep 17, 2022 · 2 comments

Comments

@Kleidukos
Copy link
Member

The Internal Happy error exception gives a CallStack that is most unhelpful, as it only gives the location of the error function used in the generated code. This could be slightly improved by having HasCallStack pragmas earlier in the program.

Moreover, more information about has failed would be appreciated. Currently I get

λ❯ runAlex "let example = 42" parseMiniML 
*** Exception: Internal Happy error

CallStack (from HasCallStack):
  error, called at /home/hecate/Code/Compiler Experiments/qamar/dist-newstyle/build/x86_64-linux/ghc-9.2.4/qamar-0.1.0.0/build/Parser.hs:1441:17 in qamar-0.1.0.0-inplace:Parser

and it's quite unbecoming.

@sgraf812
Copy link
Collaborator

sgraf812 commented Sep 13, 2024

Frankly, if you see this error then there's a bug in happy that you should report. You can't do anything about it and you are not using happy in a wrong way (at least I don't think that you are).

Did you see this error in conjunction with -XStrictData? Then this issue the same as #273, for which I provide a fix in #289.

@Kleidukos
Copy link
Member Author

Yes it must have been in conjunction with -XStrictData. See https://gist.github.com/heitor-lassarote/9cc4203990352f5df5f6b84da9291df9?permalink_comment_id=4306546#gistcomment-4306546

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants