X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=ghc%2Fcompiler%2Ftypecheck%2FTcExpr.lhs;h=15b67291bdaab4944394da158b4b624e430e7e34;hp=6b7334010693e35c8405c963a94fbae3de51d3f7;hb=10521d8418fd3a1cf32882718b5bd28992db36fd;hpb=7fa716e248a1f11fa686965f57aebbb83b74fa7b diff --git a/ghc/compiler/typecheck/TcExpr.lhs b/ghc/compiler/typecheck/TcExpr.lhs index 6b73340..15b6729 100644 --- a/ghc/compiler/typecheck/TcExpr.lhs +++ b/ghc/compiler/typecheck/TcExpr.lhs @@ -35,12 +35,7 @@ import AbsUniType import E import CE ( lookupCE ) -#ifndef DPH -import Errors ( badMatchErr, UnifyErrContext(..) ) -#else -import Errors ( badMatchErr, podCompLhsError, UnifyErrContext(..) ) -#endif {- Data Parallel Haskell -} - +import Errors import GenSpecEtc ( checkSigTyVars ) import Id ( mkInstId, getIdUniType, Id ) import Inst @@ -79,8 +74,8 @@ tcExpr e (Var name) -- isTauTy is over-paranoid, because we don't expect -- any submerged polymorphism other than rank-2 polymorphism - checkTc (not (isTauTy ty)) (error "tcExpr Var: MISSING ERROR MESSAGE") -- ToDo: - `thenTc_` + getSrcLocTc `thenNF_Tc` \ loc -> + checkTc (not (isTauTy ty)) (lurkingRank2Err name ty loc) `thenTc_` returnTc stuff \end{code} @@ -563,14 +558,15 @@ tcApp build_result_expression e orig_fun arg_exprs unify_args (arg_no+1) (App fun arg'') (lie `plusLIE` lie_arg') args arg_tys fun_res_ty unify_args arg_no fun lie [] arg_tys fun_res_ty - = -- We've run out of actual arguments Check that none of - -- arg_tys has a for-all at the top For example, "build" on + = -- We've run out of actual arguments. Check that none of + -- arg_tys has a for-all at the top. For example, "build" on -- its own is no good; it must be applied to something. let result_ty = glueTyArgs arg_tys fun_res_ty in + getSrcLocTc `thenNF_Tc` \ loc -> checkTc (not (isTauTy result_ty)) - (error "ERROR: 2 rank failure (NEED ERROR MSG [ToDo])") `thenTc_` + (underAppliedTyErr result_ty loc) `thenTc_` returnTc (fun, lie, result_ty) -- When we run out of arg_tys we go back to unify_fun in the hope