Beluga icon indicating copy to clipboard operation
Beluga copied to clipboard

Internal error

Open mb64 opened this issue 2 years ago • 1 comments

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.

mb64 avatar Jan 30 '22 09:01 mb64

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: https://github.com/Beluga-lang/Beluga/blob/6f1acde3a32f9228dbd912ca6895207b1afed7b0/src/core/lfrecon.ml#L1948-L1949

MartyO256 avatar Jan 31 '22 03:01 MartyO256