on master help sign in
tweak error message for unexpected arrow in expressions

Fixes https://github.com/elm/error-message-catalog/issues/241

commit00ee15406890dd8a3aeed2a30ed64b5b11772ebc authorEvan Czaplicki <evancz@users.noreply.github.com> dateThu 25 Jul 2019, 17:50 (7 years ago) parent98b963c
1 file changed+8−4
compiler/src/Reporting/Error/Syntax.hs+8−4
compiler/src/Reporting/Error/Syntax.hs+8−4
@@ -2868,11 +2868,15 @@ toOperatorReport source context operator row col =
28682868 else
28692869 (
28702870 D.reflow $
2871− "I was not expecting an arrow here:"
2871+ "I was partway through parsing an expression when I got stuck on this arrow:"
28722872 ,
2873− D.reflow $
2874− "Arrows should only appear in `case` expressions and anonymous functions. Maybe\
2875− \ you want > or >= instead?"
2873+ D.stack
2874+ [ "Arrows should only appear in `case` expressions and anonymous functions.\n\
2875+ \Maybe it was supposed to be a > sign instead?"
2876+ , D.toSimpleNote $
2877+ "The syntax for anonymous functions is (\\x -> x + 1) so the arguments all appear\
2878+ \ after the backslash and before the arrow. Maybe you forgot the backslash earlier?"
2879+ ]
28762880 )
28772881
28782882 BadEquals ->