summaryrefslogtreecommitdiff
path: root/compiler/rename
diff options
context:
space:
mode:
authorDr. ERDI Gergo <gergo@erdi.hu>2014-10-21 20:51:35 +0800
committerDr. ERDI Gergo <gergo@erdi.hu>2014-11-01 19:14:17 +0800
commite5ba36080d08791f44e3bed37721f702e242af96 (patch)
treea902616e3c5ec60a828133bb6576ceafde262254 /compiler/rename
parent65346865f1177fc89767de09604376ffea45bd4d (diff)
downloadhaskell-e5ba36080d08791f44e3bed37721f702e242af96.tar.gz
rnMethodBind: reject pattern synonyms in instance definitions (fixes #9705)
Diffstat (limited to 'compiler/rename')
-rw-r--r--compiler/rename/RnBinds.lhs10
1 files changed, 10 insertions, 0 deletions
diff --git a/compiler/rename/RnBinds.lhs b/compiler/rename/RnBinds.lhs
index 96cb1aa4fd..555d8333ec 100644
--- a/compiler/rename/RnBinds.lhs
+++ b/compiler/rename/RnBinds.lhs
@@ -745,6 +745,11 @@ rnMethodBind _ _ (L loc bind@(PatBind {})) = do
addErrAt loc (methodBindErr bind)
return (emptyBag, emptyFVs)
+-- Associated pattern synonyms are not implemented yet
+rnMethodBind _ _ (L loc bind@(PatSynBind {})) = do
+ addErrAt loc $ methodPatSynErr bind
+ return (emptyBag, emptyFVs)
+
rnMethodBind _ _ b = pprPanic "rnMethodBind" (ppr b)
\end{code}
@@ -1061,6 +1066,11 @@ methodBindErr mbind
= hang (ptext (sLit "Pattern bindings (except simple variables) not allowed in instance declarations"))
2 (ppr mbind)
+methodPatSynErr :: HsBindLR RdrName RdrName -> SDoc
+methodPatSynErr mbind
+ = hang (ptext (sLit "Pattern synonyms not allowed in instance declarations"))
+ 2 (ppr mbind)
+
bindsInHsBootFile :: LHsBindsLR Name RdrName -> SDoc
bindsInHsBootFile mbinds
= hang (ptext (sLit "Bindings in hs-boot files are not allowed"))