Add -XPatternSigs flag
authorIan Lynagh <igloo@earth.li>
Mon, 9 Jul 2007 17:54:11 +0000 (17:54 +0000)
committerIan Lynagh <igloo@earth.li>
Mon, 9 Jul 2007 17:54:11 +0000 (17:54 +0000)
compiler/main/DynFlags.hs
compiler/rename/RnBinds.lhs
compiler/rename/RnTypes.lhs

index a675ff3..3fdfb0b 100644 (file)
@@ -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 ]
 
index ff0629a..1733e7a 100644 (file)
@@ -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)
index 25a1c45..15f4daf 100644 (file)
@@ -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"),