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

Bad error message caused by let expression with too little indentation #235

Open
ii8 opened this issue Dec 13, 2023 · 0 comments
Open

Bad error message caused by let expression with too little indentation #235

ii8 opened this issue Dec 13, 2023 · 0 comments
Labels
accepted The issue has been reviewed and accepted for implementation bug Something isn't working

Comments

@ii8
Copy link

ii8 commented Dec 13, 2023

test =
  let n =
    identity (2 + 3)
  in n

will give the error:

-- UNFINISHED DEFINITION --------------------------------------------- Main.gren

I got stuck while parsing the `n` definition:

2|   let n = 
            ^
I was expecting to see an expression next. What is it equal to?

Here is a valid definition (with a type annotation) for reference:

    greet : String -> String
    greet name =
      "Hello " ++ name ++ "!"

which is not helpful because it suggests the same idiom of newline + 2 spaces indent after the equal sign, which happens to be valid in a function definition but not in a let expression where you need 5 or more spaces.

@robinheghan robinheghan added bug Something isn't working accepted The issue has been reviewed and accepted for implementation labels Jan 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted The issue has been reviewed and accepted for implementation bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants