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

juvix format breaks else clause in multiway if syntax #2879

Closed
paulcadman opened this issue Jul 9, 2024 · 0 comments · Fixed by #2881
Closed

juvix format breaks else clause in multiway if syntax #2879

paulcadman opened this issue Jul 9, 2024 · 0 comments · Fixed by #2881
Assignees
Milestone

Comments

@paulcadman
Copy link
Collaborator

Reproduced using the latest nightly build.

This bug was introduced since the 0.6.3 release, possibly in #2852

Consider a module that contains multiway if syntax:

module Bug;

import Stdlib.Prelude open;

a : Nat :=
  if
    | true := 1
    | else := 2;

and run juvix format --inplace, the following is the result:

module Bug;

import Stdlib.Prelude open;

a : Nat :=
  if
    | true := 1
    else := 2;

and this does not typecheck:

$ juvix typecheck Bug.juvix
/private/tmp/Bug.juvix:8:9: error:
/private/tmp/Bug.juvix:8:9:
  |
8 |     else := 2;
  |         ^
expecting |
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants