Adding pushing of hpc translation status through hi files.
[ghc-hetmet.git] / compiler / typecheck / TcType.lhs
index 56351d7..eaf2faa 100644 (file)
@@ -45,7 +45,8 @@ module TcType (
   tcSplitFunTy_maybe, tcSplitFunTys, tcFunArgTy, tcFunResultTy, tcSplitFunTysN,
   tcSplitTyConApp, tcSplitTyConApp_maybe, tcTyConAppTyCon, tcTyConAppArgs,
   tcSplitAppTy_maybe, tcSplitAppTy, tcSplitAppTys, repSplitAppTy_maybe,
-  tcValidInstHeadTy, tcGetTyVar_maybe, tcGetTyVar,
+  tcInstHeadTyNotSynonym, tcInstHeadTyAppAllTyVars,
+  tcGetTyVar_maybe, tcGetTyVar,
   tcSplitSigmaTy, tcMultiSplitSigmaTy, 
 
   ---------------------------------
@@ -451,9 +452,9 @@ pprSkolTvBinding tv
 
     ppr_skol UnkSkol       = empty     -- Unhelpful; omit
     ppr_skol RuntimeUnkSkol = ptext SLIT("is an unknown runtime type")
-    ppr_skol info           = ptext SLIT("is a rigid type variable bound by") 
-                               <+> sep [pprSkolInfo info, 
-                                        nest 2 (ptext SLIT("at") <+> ppr (getSrcLoc tv))]
+    ppr_skol info           = sep [ptext SLIT("is a rigid type variable bound by"),
+                                  sep [pprSkolInfo info, 
+                                        nest 2 (ptext SLIT("at") <+> ppr (getSrcLoc tv))]]
  
 pprSkolInfo :: SkolemInfo -> SDoc
 pprSkolInfo (SigSkol ctxt)   = pprUserTypeCtxt ctxt
@@ -790,14 +791,23 @@ tcSplitDFunHead tau
        Just (ClassP clas tys) -> (clas, tys)
        other -> panic "tcSplitDFunHead"
 
-tcValidInstHeadTy :: Type -> Bool
+tcInstHeadTyNotSynonym :: Type -> Bool
 -- Used in Haskell-98 mode, for the argument types of an instance head
 -- These must not be type synonyms, but everywhere else type synonyms
 -- are transparent, so we need a special function here
-tcValidInstHeadTy ty
+tcInstHeadTyNotSynonym ty
   = case ty of
-       NoteTy _ ty     -> tcValidInstHeadTy ty
-       TyConApp tc tys -> not (isSynTyCon tc) && ok tys
+        NoteTy _ ty     -> tcInstHeadTyNotSynonym ty
+        TyConApp tc tys -> not (isSynTyCon tc)
+        _ -> True
+
+tcInstHeadTyAppAllTyVars :: Type -> Bool
+-- Used in Haskell-98 mode, for the argument types of an instance head
+-- These must be a constructor applied to type variable arguments
+tcInstHeadTyAppAllTyVars ty
+  = case ty of
+       NoteTy _ ty     -> tcInstHeadTyAppAllTyVars ty
+       TyConApp _ tys  -> ok tys
        FunTy arg res   -> ok [arg, res]
        other           -> False
   where
@@ -1242,7 +1252,7 @@ legalFFITyCon tc
   = isUnLiftedTyCon tc || boxedMarshalableTyCon tc || tc == unitTyCon
 
 marshalableTyCon dflags tc
-  =  (dopt Opt_GlasgowExts dflags && isUnLiftedTyCon tc)
+  =  (dopt Opt_UnliftedFFITypes dflags && isUnLiftedTyCon tc)
   || boxedMarshalableTyCon tc
 
 boxedMarshalableTyCon tc