Skip to content

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

Open
@ii8

Description

@ii8
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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedThe issue has been reviewed and accepted for implementationbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions