[commit: ghc] wip/ttypeable: Fix primitive types (57ec619)

git at git.haskell.org git at git.haskell.org
Sun Jan 29 20:18:19 UTC 2017


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/ttypeable
Link       : http://ghc.haskell.org/trac/ghc/changeset/57ec619e50377acbaef827325fc76403d338221c/ghc

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

commit 57ec619e50377acbaef827325fc76403d338221c
Author: Ben Gamari <ben at smart-cactus.org>
Date:   Wed Mar 16 19:52:17 2016 +0100

    Fix primitive types


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

57ec619e50377acbaef827325fc76403d338221c
 compiler/typecheck/TcInteract.hs | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/compiler/typecheck/TcInteract.hs b/compiler/typecheck/TcInteract.hs
index 47d9f2e..ac7fed1 100644
--- a/compiler/typecheck/TcInteract.hs
+++ b/compiler/typecheck/TcInteract.hs
@@ -26,10 +26,10 @@ import Name
 import PrelNames ( knownNatClassName, knownSymbolClassName,
                    typeableClassName, coercibleTyConKey,
                    heqTyConKey, ipClassKey,
-                   trTYPE'PtrRepLiftedName, trRuntimeRepName, trArrowName )
+                   trTYPEName, trTYPE'PtrRepLiftedName, trRuntimeRepName, trArrowName )
 import TysWiredIn ( typeNatKind, typeSymbolKind, heqDataCon,
                     coercibleDataCon, runtimeRepTy )
-import TysPrim    ( eqPrimTyCon, eqReprPrimTyCon )
+import TysPrim    ( eqPrimTyCon, eqReprPrimTyCon, tYPETyCon )
 import Id( idType )
 import CoAxiom ( TypeEqn, CoAxiom(..), CoAxBranch(..), fromBranches )
 import Class
@@ -2164,7 +2164,9 @@ matchTypeable clas [k,t]  -- clas = Typeable
   | k `eqType` typeNatKind                 = doTyLit knownNatClassName         t
   | k `eqType` typeSymbolKind              = doTyLit knownSymbolClassName      t
   | t `eqType` liftedTypeKind              = doPrimRep trTYPE'PtrRepLiftedName t
+  | t `eqType` mkTyConTy tYPETyCon         = doPrimRep trTYPEName              t
   | t `eqType` runtimeRepTy                = doPrimRep trRuntimeRepName        t
+  | t `eqType` mkTyConTy funTyCon          = doPrimRep trArrowName             t
   | Just (tc, ks) <- splitTyConApp_maybe t -- See Note [Typeable (T a b c)]
   , onlyNamedBndrsApplied tc ks            = doTyConApp clas t tc
   | Just (arg,ret) <- splitFunTy_maybe t   = doFunTy    clas t arg ret



More information about the ghc-commits mailing list