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

Unparseable output with \cases and multiple patterns across multiple lines #1025

Closed
amesgen opened this issue May 17, 2023 · 0 comments · Fixed by #1026
Closed

Unparseable output with \cases and multiple patterns across multiple lines #1025

amesgen opened this issue May 17, 2023 · 0 comments · Fixed by #1026
Labels
bug Something isn't working

Comments

@amesgen
Copy link
Member

amesgen commented May 17, 2023

Describe the bug
With --unsafe, this snippet (typechecks fine)

foo = \cases
  True
   True -> True
  _ _ -> False

is formatted to

foo = \cases
  True
  True -> True
  _ _ -> False

which fails to parse with

<input>:3:3
  Parsing of formatted code failed:
  [GHC-58481] parse error (possibly incorrect indentation or mismatched brackets)

Expected behavior
It should be formatted correctly, using identation for subsequent patterns:

foo = \cases
  True
    True -> True
  _ _ -> False

Environment
Happens using Ormolu 0.6.0.1 and current master (8f2bc36)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant