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

Type Level List Parsing Error (Squeal) #631

Closed
mark-keaton opened this issue Jun 29, 2020 · 3 comments · Fixed by #654
Closed

Type Level List Parsing Error (Squeal) #631

mark-keaton opened this issue Jun 29, 2020 · 3 comments · Fixed by #654
Labels
bug Something isn't working

Comments

@mark-keaton
Copy link

Describe the bug
I had a type defined like so, which GHCID didn't like:

getRawElementsByUserSelect :: Query '[] '[] DB '[NotNull 'PGint4] (RowPG RawElementData)
    Unticked promoted constructor: ‘NotNull’.
    Use ‘'NotNull’ instead of ‘NotNull’.

So I used GHCID's suggestion:

getRawElementsByUserSelect :: Query '[] '[] DB '[ 'NotNull 'PGint4] (RowPG RawElementData)

And Ormolu stopped formatting in place:

Parsing of formatted code failed:
  src/lib/QuerySqueal.hs<rendered>:49:46
  parse error on input '
Please, consider reporting the bug.

To Reproduce
Try formatting a Type Level list like the one above.

Expected behavior
I expected the formatter to continue to run.

Environment

  • OS name + version:
    Manjaro Linux 20.0.3

  • Version of the code:
    ormolu 0.1.0.0 master 033bb16
    using ghc-lib-parser 8.10.1.20200523

Additional context
Thanks. Great tool.

@mheinzel
Copy link

If I remember correctly, this is because in '['NotNull 'PGint4], '[' is parsed as a character literal. So the space is necessary in this case.

@mrkkrp
Copy link
Member

mrkkrp commented Jul 15, 2020

Yes, it is a bug all right.

@andremarianiello
Copy link

I have this same issue.

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.

4 participants