[commit: ghc] ghc-kinds: Constraint in GHC.Prim (fce3785)

Julien Cretin julien at galois.com
Mon Sep 12 18:53:20 CEST 2011


Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : ghc-kinds

http://hackage.haskell.org/trac/ghc/changeset/fce37853f7ad44fb33dfa0f5ef16b7f72b39f87b

>---------------------------------------------------------------

commit fce37853f7ad44fb33dfa0f5ef16b7f72b39f87b
Author: Julien Cretin <ghc at ia0.eu>
Date:   Mon Sep 12 18:41:57 2011 +0200

    Constraint in GHC.Prim

>---------------------------------------------------------------

 compiler/prelude/TysPrim.lhs |    1 +
 compiler/rename/RnEnv.lhs    |   13 +------------
 2 files changed, 2 insertions(+), 12 deletions(-)

diff --git a/compiler/prelude/TysPrim.lhs b/compiler/prelude/TysPrim.lhs
index 71cc821..14495bd 100644
--- a/compiler/prelude/TysPrim.lhs
+++ b/compiler/prelude/TysPrim.lhs
@@ -120,6 +120,7 @@ primTyCons
     , word32PrimTyCon
     , word64PrimTyCon
     , anyTyCon
+    , constraintKindTyCon
     , eqPrimTyCon
     ]
 
diff --git a/compiler/rename/RnEnv.lhs b/compiler/rename/RnEnv.lhs
index 23d2978..dbd9779 100644
--- a/compiler/rename/RnEnv.lhs
+++ b/compiler/rename/RnEnv.lhs
@@ -42,7 +42,6 @@ import IfaceEnv		( lookupOrig, newGlobalBinder, updNameCache, extendNameCache )
 import HsSyn
 import RdrHsSyn		( extractHsTyRdrTyVars )
 import RdrName
-import TysPrim          ( constraintKindTyConName )
 import HscTypes		( NameCache(..), availNames, ModIface(..), FixItem(..), lookupFixity)
 import TcEnv		( tcLookupDataCon, tcLookupField, isBrackStage )
 import TcRnMonad
@@ -461,16 +460,6 @@ lookupOccRn_maybe rdr_name
        ; case mb_name of {
                 Just name  -> return (Just name) ;
                 Nothing -> do
-       { -- Check if the RdrName is Constraint
-         traceRn (ppr (nameRdrName constraintKindTyConName) <+> ppr rdr_name)
-       ; if rdrNameOcc rdr_name == nameOccName constraintKindTyConName
-           then do
-             constraint_ok <- xoptM Opt_ConstraintKinds
-             if constraint_ok
-               then return (Just constraintKindTyConName)
-               else failWith (hang (ptext (sLit "Constraint is not in scope"))
-                                 2 (ptext (sLit "Perhaps you meant to use -XConstraintKinds?")))
-         else do
        { -- We allow qualified names on the command line to refer to
          --  *any* name exported by any module in scope, just as if there
          -- was an "import qualified M" declaration for every module.
@@ -481,7 +470,7 @@ lookupOccRn_maybe rdr_name
        ; if isQual rdr_name && allow_qual && is_ghci
          then lookupQualifiedName rdr_name
          else do { traceRn (text "lookupOccRn" <+> ppr rdr_name)
-                 ; return Nothing } } } } } } }
+                 ; return Nothing } } } } } }
 
 
 lookupGlobalOccRn :: RdrName -> RnM Name





More information about the Cvs-ghc mailing list