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 error #253

Open
mb64 opened this issue Jan 30, 2022 · 1 comment
Open

Internal error #253

mb64 opened this issue Jan 30, 2022 · 1 comment
Labels
A | frontend related to the lexer or parser B | enhancement new features

Comments

@mb64
Copy link

mb64 commented Jan 30, 2022

I'm trying to go through the NbE example, and got an internal error. I've simplified it to this:

$ cat bug.bel
LF tm : type =
  | abs : (tm → tm) → tm;

rec thing : [⊢ tm] → [⊢ tm] = fn t ⇒ case t of
  | [ ⊢ abs (λx. E)] ⇒ ?hole;
$ beluga bug.bel
## Type Reconstruction begin: bug.bel ##
Internal error (please report as a bug):
[elTerm'] Proj (FMVar _, _)

I've since figured out that the syntax has changed to only allow \ instead of λ, but I'm reporting the bug anyway as requested.

@MartyO256
Copy link
Member

This error occurs because λx is parsed as a free meta-variable with name λx, which cannot occur in a projection with the . operator. Like you wrote, \ is expected instead of λ, and error reporting needs improvement.
The error is raised from the elTerm' function in the LF reconstruction module:

Beluga/src/core/lfrecon.ml

Lines 1948 to 1949 in 6f1acde

| Apx.LF.Root (loc, Apx.LF.Proj (Apx.LF.FMVar _, _), _) ->
raise (Error.Violation "[elTerm'] Proj (FMVar _, _)")

@MartyO256 MartyO256 added B | enhancement new features A | frontend related to the lexer or parser labels Jun 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A | frontend related to the lexer or parser B | enhancement new features
Projects
None yet
Development

No branches or pull requests

2 participants