summaryrefslogtreecommitdiff
path: root/compiler/parser/RdrHsSyn.lhs
diff options
context:
space:
mode:
authorIavor S. Diatchki <iavor.diatchki@gmail.com>2012-03-24 16:01:00 -0700
committerIavor S. Diatchki <iavor.diatchki@gmail.com>2012-03-24 16:01:00 -0700
commit81b2b11864bfb6a6dcf1834b228a0df4e5b1034e (patch)
tree4dd438ece38e4677203ed61ddfe67904da055ca3 /compiler/parser/RdrHsSyn.lhs
parent8bb2730c3df539c3d57ebd85c9890ea3a3591d17 (diff)
downloadhaskell-81b2b11864bfb6a6dcf1834b228a0df4e5b1034e.tar.gz
Add -XExplicitNamespaces to enable using 'type' in import/exports.
This extension is implied by: * TypeOperators: so that we can import/export things like (+) * TypeFamilies: because associated type synonyms use "type T" to name the associated type in a subordinate list.
Diffstat (limited to 'compiler/parser/RdrHsSyn.lhs')
-rw-r--r--compiler/parser/RdrHsSyn.lhs11
1 files changed, 10 insertions, 1 deletions
diff --git a/compiler/parser/RdrHsSyn.lhs b/compiler/parser/RdrHsSyn.lhs
index a847f55d19..b6893cf893 100644
--- a/compiler/parser/RdrHsSyn.lhs
+++ b/compiler/parser/RdrHsSyn.lhs
@@ -49,7 +49,8 @@ module RdrHsSyn (
-- Help with processing exports
ImpExpSubSpec(..),
- mkModuleImpExp
+ mkModuleImpExp,
+ mkTypeImpExp
) where
@@ -1041,6 +1042,14 @@ mkModuleImpExp name subs =
where
nameT = setRdrNameSpace name tcClsName
+
+mkTypeImpExp :: Located RdrName -> P (Located RdrName)
+mkTypeImpExp name =
+ do allowed <- extension explicitNamespacesEnabled
+ if allowed
+ then return (fmap (`setRdrNameSpace` tcClsName) name)
+ else parseErrorSDoc (getLoc name)
+ (text "Illegal keyword 'type' (use -XExplicitNamespaces to enable)")
\end{code}
-----------------------------------------------------------------------------