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

elm-format causes “UNFINISHED PARENTHESES” compiler error #750

Open
lydell opened this issue Oct 8, 2021 · 0 comments
Open

elm-format causes “UNFINISHED PARENTHESES” compiler error #750

lydell opened this issue Oct 8, 2021 · 0 comments

Comments

@lydell
Copy link
Contributor

lydell commented Oct 8, 2021

This is valid according to Elm 0.19.1:

module Main exposing (main)

import Html


main =
    let
        text =
            String.toUpper
                (String.trim """
Hello!
"""
            )
    in
    Html.text text

elm-format 0.8.5 turns that into:

module Main exposing (main)

import Html


main =
    let
        text =
            String.toUpper
                (String.trim """
Hello!
""")
    in
    Html.text text

Diff:

             String.toUpper
                 (String.trim """
 Hello!
-"""
-            )
+""")
     in
     Html.text text

Trying to compile that, Elm reports this error:

-- UNFINISHED PARENTHESES ----------------------------------------- src/Main.elm

I was expecting to see a closing parenthesis next:

10|                 (String.trim """
11| Hello!
12| """)
       ^
Try adding a ) to see if that helps!

Note: I can get confused by indentation in cases like this, so maybe you have a
closing parenthesis but it is not indented enough?

Workaround:

module Main exposing (main)

import Html


main =
    let
        text =
            String.toUpper <|
                String.trim """
Hello!
"""
    in
    Html.text text
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant