From 9282daea70e7c3d8023e1d5567dc903260332e97 Mon Sep 17 00:00:00 2001 From: simonpj <unknown> Date: Fri, 30 Jun 2000 13:10:38 +0000 Subject: [PATCH] [project @ 2000-06-30 13:10:38 by simonpj] Improve error message --- ghc/compiler/typecheck/TcMonoType.lhs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ghc/compiler/typecheck/TcMonoType.lhs b/ghc/compiler/typecheck/TcMonoType.lhs index 2e6a570decf6..c5356849360e 100644 --- a/ghc/compiler/typecheck/TcMonoType.lhs +++ b/ghc/compiler/typecheck/TcMonoType.lhs @@ -201,7 +201,7 @@ tc_type_kind (HsUsgForAllTy uv_name ty) tc_type_kind ty `thenTc` \ (kind, tc_ty) -> returnTc (kind, mkUsForAllTy uv tc_ty) -tc_type_kind (HsForAllTy (Just tv_names) context ty) +tc_type_kind full_ty@(HsForAllTy (Just tv_names) context ty) = tcExtendTyVarScope tv_names $ \ forall_tyvars -> tcContext context `thenTc` \ theta -> tc_type_kind ty `thenTc` \ (kind, tau) -> @@ -240,8 +240,8 @@ tc_type_kind (HsForAllTy (Just tv_names) context ty) not (ct_var `elemUFM` extended_tau_vars) is_free ct_var = not (ct_var `elem` forall_tyvars) - check_pred pred = checkTc (not any_ambig) (ambigErr pred ty) `thenTc_` - checkTc (not all_free) (freeErr pred ty) + check_pred pred = checkTc (not any_ambig) (ambigErr pred full_ty) `thenTc_` + checkTc (not all_free) (freeErr pred full_ty) where ct_vars = varSetElems (tyVarsOfPred pred) any_ambig = is_source_polytype && any is_ambig ct_vars -- GitLab