X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Ftypecheck%2FTcTyClsDecls.lhs;h=27476db02f73a23c90bbc2c52908e581c38d3ce9;hb=76293b141bba4c15a6fd619dd980502e98614790;hp=5101ab316405fe829a1947ec2c8270f3ea5b10a3;hpb=711e4d7a4d65472a3a1fb35bcad8e1c9a109c728;p=ghc-hetmet.git diff --git a/ghc/compiler/typecheck/TcTyClsDecls.lhs b/ghc/compiler/typecheck/TcTyClsDecls.lhs index 5101ab3..27476db 100644 --- a/ghc/compiler/typecheck/TcTyClsDecls.lhs +++ b/ghc/compiler/typecheck/TcTyClsDecls.lhs @@ -25,11 +25,11 @@ import TcMonad import TcEnv ( TcEnv, RecTcEnv, TcTyThing(..), TyThing(..), TyThingDetails(..), tcExtendKindEnv, tcLookup, tcExtendGlobalEnv, isLocalThing ) -import TcTyDecls ( tcTyDecl, kcConDetails, checkValidTyCon ) -import TcClassDcl ( tcClassDecl1, checkValidClass ) +import TcTyDecls ( tcTyDecl, kcConDetails ) +import TcClassDcl ( tcClassDecl1 ) import TcInstDcls ( tcAddDeclCtxt ) import TcMonoType ( kcHsTyVars, kcHsType, kcHsLiftedSigType, kcHsContext, mkTyClTyVars ) -import TcMType ( newKindVar, zonkKindEnv ) +import TcMType ( newKindVar, zonkKindEnv, checkValidTyCon, checkValidClass ) import TcUnify ( unifyKind ) import TcType ( Type, Kind, TcKind, mkArrowKind, liftedTypeKind, zipFunTys ) import Type ( splitTyConApp_maybe ) @@ -334,6 +334,9 @@ buildTyConOrClass dflags is_rec kenv rec_vrcs rec_details tycon = mkAlgTyCon tycon_name tycon_kind tyvars ctxt argvrcs data_cons sel_ids flavour is_rec gen_info + -- It's not strictly necesary to mark newtypes as + -- recursive if the loop is broken via a data type. + -- But I'm not sure it's worth the hassle of discovering that. gen_info | not (dopt Opt_Generics dflags) = Nothing | otherwise = mkTyConGenInfo tycon sys_names