[commit: ghc] master: Simple refactor to remove misleading comment (3562727)

git at git.haskell.org git at git.haskell.org
Thu Oct 27 07:28:48 UTC 2016


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

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

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

commit 3562727fd8a8bf5bc5aa0474a78f6c14f14f95a0
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Wed Oct 26 14:57:57 2016 +0100

    Simple refactor to remove misleading comment


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

3562727fd8a8bf5bc5aa0474a78f6c14f14f95a0
 compiler/typecheck/TcTyClsDecls.hs | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/compiler/typecheck/TcTyClsDecls.hs b/compiler/typecheck/TcTyClsDecls.hs
index 46784f6..734a3a3 100644
--- a/compiler/typecheck/TcTyClsDecls.hs
+++ b/compiler/typecheck/TcTyClsDecls.hs
@@ -742,14 +742,12 @@ tcTyClDecl1 _parent roles_info
             , tcdATs = ats, tcdATDefs = at_defs })
   = ASSERT( isNothing _parent )
     do { clas <- fixM $ \ clas ->
+            -- We need the knot becase 'clas' is passed into tcClassATs
             tcTyClTyVars class_name $ \ binders res_kind ->
             do { MASSERT( isConstraintKind res_kind )
-                 -- This little knot is just so we can get
-                 -- hold of the name of the class TyCon, which we
-                 -- need to look up its recursiveness
                ; traceTc "tcClassDecl 1" (ppr class_name $$ ppr binders)
-               ; let tycon_name = tyConName (classTyCon clas)
-                     roles = roles_info tycon_name
+               ; let tycon_name = class_name        -- We use the same name
+                     roles = roles_info tycon_name  -- for TyCon and Class
 
                ; ctxt' <- solveEqualities $ tcHsContext ctxt
                ; ctxt' <- zonkTcTypeToTypes emptyZonkEnv ctxt'



More information about the ghc-commits mailing list