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: [fmt_ppr_lf_infix_operator] spine length <> 2 #272

Open
ryanakca opened this issue Jul 3, 2024 · 3 comments
Open

Internal error: [fmt_ppr_lf_infix_operator] spine length <> 2 #272

ryanakca opened this issue Jul 3, 2024 · 3 comments
Labels
A | printing affecting the pretty-printer, error messages, etc. B | bug unexpected or incorrect behaviour

Comments

@ryanakca
Copy link
Contributor

ryanakca commented Jul 3, 2024

Beluga v1.1.1 gives

$ beluga mwe.bel
## Type Reconstruction begin: mwe.bel ##
Internal error. Please report this as a bug.
[fmt_ppr_lf_infix_operator] spine length <> 2

on the following file

module Type = struct

tp : type.
mytp : tp.

rel : tp → tp → type. --infix rel.
rel : A rel B.
end;

--open Type.

test : tp → tp → type.
test/i : rel A B → test A B.
let broken : [⊢ test mytp mytp] = [⊢ test/i (Type.rel)];
@Ailrun
Copy link
Member

Ailrun commented Jul 3, 2024

Possibly because you used rel A B instead of A rel B in the test/i?
But with that message it is a bug anyway. It should print a better error message for such a case.

@ryanakca
Copy link
Contributor Author

ryanakca commented Jul 3, 2024

Possibly. However, my understanding is that the --infix pragma is local to a module. Or at least, every time I've opened a module that contains --infix pragmas, I've had to explicitly respecify them after the --open pragma. (I think this is the most compositional approach: the explicit precedence levels declared in a module might clash with the precedence levels of relations already in scope at the --open pragma, so you should have to specify the precedence levels appropriate for the current context each time you open a module.)

@MartyO256
Copy link
Member

MartyO256 commented Jul 5, 2024

Since version 1.1.1, there have been some bug fixes related to modules and fixity pragmas in commits e5adcb9 and 0e99faf. A different error message is printed for that signature during parsing. A minor version release could be created and uploaded on the opam repository.

EDIT: Beluga version 1.1.2 has been released with those aforementioned bugfixes.

@MartyO256 MartyO256 added B | bug unexpected or incorrect behaviour A | printing affecting the pretty-printer, error messages, etc. labels Jul 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A | printing affecting the pretty-printer, error messages, etc. B | bug unexpected or incorrect behaviour
Projects
None yet
Development

No branches or pull requests

3 participants