summaryrefslogtreecommitdiff
path: root/compiler/rename/RnExpr.hs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rename/RnExpr.hs')
-rw-r--r--compiler/rename/RnExpr.hs10
1 files changed, 8 insertions, 2 deletions
diff --git a/compiler/rename/RnExpr.hs b/compiler/rename/RnExpr.hs
index 811ecbafbe..17c9042f22 100644
--- a/compiler/rename/RnExpr.hs
+++ b/compiler/rename/RnExpr.hs
@@ -336,8 +336,14 @@ We return a (bogus) EWildPat in each case.
-}
rnExpr EWildPat = return (hsHoleExpr, emptyFVs) -- "_" is just a hole
-rnExpr e@(EAsPat {}) =
- patSynErr e (text "Did you mean to enable TypeApplications?")
+rnExpr e@(EAsPat {})
+ = do { opt_TypeApplications <- xoptM LangExt.TypeApplications
+ ; let msg | opt_TypeApplications
+ = "Type application syntax requires a space before '@'"
+ | otherwise
+ = "Did you mean to enable TypeApplications?"
+ ; patSynErr e (text msg)
+ }
rnExpr e@(EViewPat {}) = patSynErr e empty
rnExpr e@(ELazyPat {}) = patSynErr e empty