on master help sign in
make the error message for weird -> in case expressions a bit nicer
aaa2d65Evan Czaplicki
compiler/src/Reporting/Error/Syntax.hs+4−3
@@ -2820,7 +2820,7 @@ toOperatorReport source context operator row col =
2820 ,
2820 ,
2821 D.stack
2821 D.stack
2822 [ D.reflow $
2822 [ D.reflow $
2823− "It makes sense to see arrows around here, so I suspect it is something earlier."
2823+ "It makes sense to see arrows around here, so I suspect it is something earlier. Maybe this pattern is indented a bit farther than the previous patterns?"
2824 , noteForCaseIndentError
2824 , noteForCaseIndentError
2825 ]
2825 ]
2826 )
2826 )
@@ -3536,8 +3536,9 @@ noteForCaseIndentError =
3536 , D.indent 8 $ D.fillSep [D.dullyellow "400"]
3536 , D.indent 8 $ D.fillSep [D.dullyellow "400"]
3537 ]
3537 ]
3538 , D.reflow $
3538 , D.reflow $
3539− "Notice the indentation! Each pattern is aligned, and each branch is indented\
3539+ "Notice the indentation! Patterns are aligned with each other. Same indentation.\
3540+ \ The expressions after each arrow are all indented a bit more than the patterns.\
3540− \ a bit more than the corresponding pattern. That is important!"
3541+ \ That is important!"
3541 ]
3542 ]
3542
3543
3543
3544