gren-lang / gren-lang/compiler
Unhelpful error message for case/of
Open
Nobody has claimed this yet.
- Dominant language
- Haskell
- Stars
- 503
- Forks
- 29
- PR merge metrics
- No merged PRs in 30d
Description
If you use the outdated case/of syntax for a when/is expression, this is the error message:
-- UNEXPECTED ARROW ---------------------------------------------- src/Main.gren
I was partway through parsing an expression when I got stuck on this arrow:
9| True ->
^^
Arrows should only appear in `when` expressions and anonymous functions.
Maybe it was supposed to be a > sign instead?
Note: The syntax for anonymous functions is (\x -> x + 1) so the arguments all
appear after the backslash and before the arrow. Maybe a backslash is missing
earlier?
Seems like something we should explicitly check for. "Looks like you're using outdated syntax..." or something.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names no files or tests. Start by locating the parser diagnostic that reports the unexpected arrow for outdated case/of syntax, then add regression coverage using the shown input; done means the diagnostic explicitly identifies the outdated syntax.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- haskell
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100