Fix Trac #3966: warn about useless UNPACK pragmas
[ghc-hetmet.git] / compiler / typecheck / TcExpr.lhs
index 47e4c6f..d7118e1 100644 (file)
@@ -850,12 +850,12 @@ tcId :: InstOrigin
      -> BoxyRhoType                            -- Result type
      -> TcM (HsExpr TcId)
 tcId orig fun_name res_ty
-  = do { traceTc (text "tcId" <+> ppr fun_name <+> ppr res_ty)
-       ; (fun, fun_ty) <- lookupFun orig fun_name
-
+  = do { (fun, fun_ty) <- lookupFun orig fun_name
+        ; traceTc (text "tcId" <+> ppr fun_name <+> (ppr fun_ty $$ ppr res_ty))
+       
        -- Split up the function type
        ; let (tv_theta_prs, fun_tau) = tcMultiSplitSigmaTy fun_ty
-             qtvs = concatMap fst tv_theta_prs -- Quantified tyvars
+             qtvs = concatMap fst tv_theta_prs         -- Quantified tyvars
              tau_qtvs = exactTyVarsOfType fun_tau      -- Mentioned in the tau part
        ; qtv_tys <- preSubType qtvs tau_qtvs fun_tau res_ty
 
@@ -863,6 +863,8 @@ tcId orig fun_name res_ty
        ; let res_subst = zipTopTvSubst qtvs qtv_tys
              fun_tau'  = substTy res_subst fun_tau
 
+        ; traceTc (text "tcId2" <+> ppr fun_name <+> (ppr qtvs $$ ppr qtv_tys))
+
        ; co_fn <- tcSubExp orig fun_tau' res_ty
 
        -- And pack up the results
@@ -1278,7 +1280,7 @@ checkMissingFields :: DataCon -> HsRecordBinds Name -> TcM ()
 checkMissingFields data_con rbinds
   | null field_labels  -- Not declared as a record;
                        -- But C{} is still valid if no strict fields
-  = if any isMarkedStrict field_strs then
+  = if any isBanged field_strs then
        -- Illegal if any arg is strict
        addErrTc (missingStrictFields data_con [])
     else
@@ -1295,12 +1297,12 @@ checkMissingFields data_con rbinds
   where
     missing_s_fields
        = [ fl | (fl, str) <- field_info,
-                isMarkedStrict str,
+                isBanged str,
                 not (fl `elem` field_names_used)
          ]
     missing_ns_fields
        = [ fl | (fl, str) <- field_info,
-                not (isMarkedStrict str),
+                not (isBanged str),
                 not (fl `elem` field_names_used)
          ]