elm-lang / elm-repl

A REPL for Elm
BSD 3-Clause "New" or "Revised" License
170 stars 34 forks source link

Cryptic error message when starting line with `let` #131

Open stevenheidel opened 7 years ago

stevenheidel commented 7 years ago

I tried the following line in the elm-repl:

let sample = "Multipart/mixed; boundary=\"sample_boundary\";"

My problem here is that I added a let at the beginning when it shouldn't be there. So this works:

> sample = "Multipart/mixed; boundary=\"sample_boundary\";"
"Multipart/mixed; boundary=\"sample_boundary\";" : String

However, the one with the let gives me this cryptic error message:

> let sample = "Multipart/mixed; boundary=\"sample_boundary\";"
-- SYNTAX PROBLEM -------------------------------------------- repl-temp-000.elm

I need whitespace, but got stuck on what looks like a new declaration. You are
either missing some stuff in the declaration above or just need to add some
spaces here:

5| t_s_o_l = ()
   ^
I am looking for one of the following things:

    whitespace

No idea what t_s_o_l is.

EDIT: elm repl --version 0.17.1

process-bot commented 7 years ago

Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it!

Here is what to expect next, and if anyone wants to comment, keep these things in mind.

ehamberg commented 7 years ago

We also just hit this issue in 0.18.0:

---- elm-repl 0.18.0 -----------------------------------------------------------
 :help for help, :exit to exit, more at <https://github.com/elm-lang/elm-repl>
--------------------------------------------------------------------------------
> let x = 1
-- SYNTAX PROBLEM -------------------------------------------- repl-temp-000.elm

I need whitespace, but got stuck on what looks like a new declaration. You are
either missing some stuff in the declaration above or just need to add some
spaces here:

4| t_s_o_l = ()
   ^
I am looking for one of the following things:

    whitespace
plumpNation commented 7 years ago

Working use case of let in is shown here -> https://guide.elm-lang.org/architecture/user_input/forms.html

Cannot help with the t_s_o_l, need to look furthur.

85