Commit aab1ff04 authored by Ian Lynagh's avatar Ian Lynagh
Browse files

Add -XPatternSigs flag

parent f48c36d1
......@@ -194,6 +194,7 @@ data DynFlag
| Opt_MagicHash
| Opt_EmptyDataDecls
| Opt_KindSignatures
| Opt_PatternSignatures
| Opt_ParallelListComp
| Opt_GeneralizedNewtypeDeriving
| Opt_RecursiveDo
......@@ -1120,6 +1121,7 @@ xFlags = [
( "PolymorphicComponents", Opt_PolymorphicComponents ),
( "ExistentialQuantification", Opt_ExistentialQuantification ),
( "KindSignatures", Opt_KindSignatures ),
( "PatternSignatures", Opt_PatternSignatures ),
( "EmptyDataDecls", Opt_EmptyDataDecls ),
( "ParallelListComp", Opt_ParallelListComp ),
( "FI", Opt_FFI ), -- support `-ffi'...
......@@ -1192,6 +1194,7 @@ glasgowExtsFlags = [ Opt_GlasgowExts
, Opt_ParallelListComp
, Opt_EmptyDataDecls
, Opt_KindSignatures
, Opt_PatternSignatures
, Opt_GeneralizedNewtypeDeriving
, Opt_TypeFamilies ]
......
......@@ -555,10 +555,10 @@ rnMatch' ctxt match@(Match pats maybe_rhs_sig grhss)
=
-- Deal with the rhs type signature
bindPatSigTyVarsFV rhs_sig_tys $
doptM Opt_GlasgowExts `thenM` \ opt_GlasgowExts ->
doptM Opt_PatternSignatures `thenM` \ opt_PatternSignatures ->
(case maybe_rhs_sig of
Nothing -> returnM (Nothing, emptyFVs)
Just ty | opt_GlasgowExts -> rnHsTypeFVs doc_sig ty `thenM` \ (ty', ty_fvs) ->
Just ty | opt_PatternSignatures -> rnHsTypeFVs doc_sig ty `thenM` \ (ty', ty_fvs) ->
returnM (Just ty', ty_fvs)
| otherwise -> addLocErr ty patSigErr `thenM_`
returnM (Nothing, emptyFVs)
......
......@@ -572,7 +572,7 @@ rnPat (VarPat name)
returnM (VarPat vname, emptyFVs)
rnPat (SigPatIn pat ty)
= doptM Opt_GlasgowExts `thenM` \ glaExts ->
= doptM Opt_PatternSignatures `thenM` \ glaExts ->
if glaExts
then rnLPat pat `thenM` \ (pat', fvs1) ->
......@@ -815,7 +815,7 @@ bogusCharError c
patSigErr ty
= (ptext SLIT("Illegal signature in pattern:") <+> ppr ty)
$$ nest 4 (ptext SLIT("Use -fglasgow-exts to permit it"))
$$ nest 4 (ptext SLIT("Use -XPatternSigs to permit it"))
dupFieldErr str dup
= hsep [ptext SLIT("duplicate field name"),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment