compiler icon indicating copy to clipboard operation
compiler copied to clipboard

Malformed record modify `{ key | }` creates EXTRA COMMA error

Open jfine2358 opened this issue 4 years ago • 1 comments

Quick Summary: Malformed record modify { key | } creates EXTRA COMMA error.

SSCCE

$ elm repl
---- Elm 0.19.1 ----------------------------------------------------------------
> { key | }
-- EXTRA COMMA ------------------------------------------------------------ REPL
I am partway through parsing a record, but I got stuck here:
3|   { key | }
             ^
Trailing commas are not allowed in records.

There is no comma, let alone an extra comma. The error message could be improved. (I suspect that allowing { key | } would be contrary to Elm practice.)

  • Elm: 0.19
  • Browser: None
  • Operating System: Not relevant (Linux).

Additional Details

I suspect that {key | puts the compiler into a prev_token = Comma state.

jfine2358 avatar Mar 15 '21 10:03 jfine2358

Thanks for reporting this! To set expectations:

  • Issues are reviewed in batches, so it can take some time to get a response.
  • Ask questions in a community forum. You will get an answer quicker that way!
  • If you experience something similar, open a new issue. We like duplicates.

Finally, please be patient with the core team. They are trying their best with limited resources.

github-actions[bot] avatar Mar 15 '21 10:03 github-actions[bot]