[commit: ghc] master: Add a case to checkValidTyCon (ca173aa)

git at git.haskell.org git at git.haskell.org
Wed May 13 11:48:47 UTC 2015


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/ca173aa30467a0b1023682d573fcd94244d85c50/ghc

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

commit ca173aa30467a0b1023682d573fcd94244d85c50
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Wed May 13 12:44:12 2015 +0100

    Add a case to checkValidTyCon
    
    Apparently when Haddock'ing, we check GHC.Prim.
    So checkValidTyCon must not crash when dealing with
    PrimTyCons; and it was doing so in dataConStupidTheta.
    
    The fix is easy, but I'm puzzled about why Haddock needs to
    typecheck GHC.Prim.


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

ca173aa30467a0b1023682d573fcd94244d85c50
 compiler/typecheck/TcTyClsDecls.hs | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/compiler/typecheck/TcTyClsDecls.hs b/compiler/typecheck/TcTyClsDecls.hs
index 59ff6cb..1b324f6 100644
--- a/compiler/typecheck/TcTyClsDecls.hs
+++ b/compiler/typecheck/TcTyClsDecls.hs
@@ -1451,6 +1451,9 @@ checkValidTyCl thing
 
 checkValidTyCon :: TyCon -> TcM ()
 checkValidTyCon tc
+  | isPrimTyCon tc   -- Happens when Haddock'ing GHC.Prim
+  = return ()
+
   | Just cl <- tyConClass_maybe tc
   = checkValidClass cl
 



More information about the ghc-commits mailing list