summaryrefslogtreecommitdiff
path: root/compiler/parser
diff options
context:
space:
mode:
authorRupert Horlick <ruperthorlick@gmail.com>2017-03-06 13:44:40 -0500
committerBen Gamari <ben@smart-cactus.org>2017-03-06 17:23:02 -0500
commit6177c0d8bdc6f5c0675b2eace592620abb658787 (patch)
treeb798c7cc95a3c6e6f77a9e9cef11a1332504ed3e /compiler/parser
parentf57bd2ae8fc787f14aeafa3f2f7ded253456528c (diff)
downloadhaskell-6177c0d8bdc6f5c0675b2eace592620abb658787.tar.gz
Disallow unboxed string literals in patterns (#13260)
Signed-off-by: Rupert Horlick <ruperthorlick@gmail.com> Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3286
Diffstat (limited to 'compiler/parser')
-rw-r--r--compiler/parser/RdrHsSyn.hs3
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/parser/RdrHsSyn.hs b/compiler/parser/RdrHsSyn.hs
index 2c63c428b6..e06c7e36c0 100644
--- a/compiler/parser/RdrHsSyn.hs
+++ b/compiler/parser/RdrHsSyn.hs
@@ -829,6 +829,9 @@ checkAPat msg loc e0 = do
case e0 of
EWildPat -> return (WildPat placeHolderType)
HsVar x -> return (VarPat x)
+ HsLit (HsStringPrim _ _) -- (#13260)
+ -> parseErrorSDoc loc (text "Illegal unboxed string literal in pattern:" $$ ppr e0)
+
HsLit l -> return (LitPat l)
-- Overloaded numeric patterns (e.g. f 0 x = x)