Improve crash message from applyTys and applyTypeToArgs
authorsimonpj@microsoft.com <unknown>
Tue, 23 Sep 2008 13:54:19 +0000 (13:54 +0000)
committersimonpj@microsoft.com <unknown>
Tue, 23 Sep 2008 13:54:19 +0000 (13:54 +0000)
compiler/coreSyn/CoreUtils.lhs
compiler/types/Type.lhs

index f44967e..44ca27a 100644 (file)
@@ -154,7 +154,8 @@ applyTypeToArgs e op_ty (Type ty : args)
     go rev_tys rest_args        = applyTypeToArgs e op_ty' rest_args
                                where
                                  op_ty' = applyTysD msg op_ty (reverse rev_tys)
-                                 msg = panic_msg e op_ty
+                                 msg = ptext (sLit "applyTypeToArgs") <+> 
+                                       panic_msg e op_ty
 
 applyTypeToArgs e op_ty (_ : args)
   = case (splitFunTy_maybe op_ty) of
index cf38146..e2405a8 100644 (file)
@@ -739,8 +739,8 @@ applyTysD doc orig_fun_ty arg_tys
                (mkForAllTys (drop n_args tvs) rho_ty)
   | otherwise          -- Too many type args
   = ASSERT2( n_tvs > 0, doc $$ ppr orig_fun_ty )       -- Zero case gives infnite loop!
-    applyTys (substTyWith tvs (take n_tvs arg_tys) rho_ty)
-            (drop n_tvs arg_tys)
+    applyTysD doc (substTyWith tvs (take n_tvs arg_tys) rho_ty)
+                 (drop n_tvs arg_tys)
   where
     (tvs, rho_ty) = splitForAllTys orig_fun_ty 
     n_tvs = length tvs