compiler icon indicating copy to clipboard operation
compiler copied to clipboard

Confusing wording on syntax error

Open tankorsmash opened this issue 4 years ago • 1 comments

https://github.com/elm/compiler/blob/770071accf791e8171440709effe71e78a9ab37c/compiler/src/Reporting/Error/Syntax.hs#L5081

Only the :: symbol that works in patterns. It is useful if you are pattern matching on lists, trying to get the first element off the front. Did you want that instead?

A rough ellie example that demonstrates the error:

I ran into the -> symbol unexpectedly in this pattern:

51|                 (String -> Result Decode.Error String) asd -> "Funnnccc"
                            ^^
Only the :: symbol that works in patterns. It is useful if you are pattern
matching on lists, trying to get the first element off the front. Did you want
that instead?

I'm new to Elm so maybe it's obvious with more knowledge, but it seems to be telling me that only the :: symbol works in patterns. I'm not clear on what it should be trying to tell me though.

tankorsmash avatar Jul 26 '21 03:07 tankorsmash

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 Jul 26 '21 03:07 github-actions[bot]